mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
23 lines
814 B
PowerShell
23 lines
814 B
PowerShell
function New-ConditionalText {
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
$Text,
|
|
[System.Drawing.Color]$ConditionalTextColor="DarkRed",
|
|
[System.Drawing.Color]$BackgroundColor="LightPink",
|
|
[OfficeOpenXml.Style.ExcelFillStyle]$PatternType=[OfficeOpenXml.Style.ExcelFillStyle]::Solid,
|
|
[ValidateSet("ContainsText","NotContainsText","BeginsWith","EndsWith")]
|
|
$ConditionalType="ContainsText"
|
|
)
|
|
|
|
$obj = [PSCustomObject]@{
|
|
Text = $Text
|
|
ConditionalTextColor = $ConditionalTextColor
|
|
ConditionalType = $ConditionalType
|
|
PatternType = $PatternType
|
|
BackgroundColor = $BackgroundColor
|
|
}
|
|
|
|
$obj.pstypenames.Clear()
|
|
$obj.pstypenames.Add("ConditionalText")
|
|
$obj
|
|
} |