mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Icon sets
This commit is contained in:
@@ -40,7 +40,8 @@ function Export-Excel {
|
||||
[Switch]$AutoFilter,
|
||||
[Switch]$BoldTopRow,
|
||||
[string]$RangeName,
|
||||
[string]$TableName
|
||||
[string]$TableName,
|
||||
[Object[]]$ConditionalFormat
|
||||
)
|
||||
|
||||
Begin {
|
||||
@@ -53,6 +54,18 @@ function Export-Excel {
|
||||
|
||||
$ws = $pkg | Add-WorkSheet -WorkSheetname $WorkSheetname -NoClobber:$NoClobber
|
||||
|
||||
foreach($format in $ConditionalFormat ) {
|
||||
#$obj = [PSCustomObject]@{
|
||||
# Address = $Address
|
||||
# Formatter = $ConditionalFormat
|
||||
# IconType = $bp.IconType
|
||||
#}
|
||||
|
||||
$target = "Add$($format.Formatter)"
|
||||
$rule = ($ws.ConditionalFormatting).$target($format.Address, $format.IconType)
|
||||
$rule.Reverse = $format.Reverse
|
||||
}
|
||||
|
||||
$Row = 1
|
||||
if($Title) {
|
||||
$ws.Cells[$Row, 1].Value = $Title
|
||||
|
||||
@@ -3,7 +3,8 @@ function New-ConditionalFormattingIconSet {
|
||||
[Parameter(Mandatory=$true)]
|
||||
$Address,
|
||||
[ValidateSet("ThreeIconSet","FourIconSet","FiveIconSet")]
|
||||
$ConditionalFormat
|
||||
$ConditionalFormat,
|
||||
[bool]$Reverse
|
||||
)
|
||||
|
||||
DynamicParam {
|
||||
@@ -44,6 +45,7 @@ function New-ConditionalFormattingIconSet {
|
||||
Address = $Address
|
||||
Formatter = $ConditionalFormat
|
||||
IconType = $bp.IconType
|
||||
Reverse = $Reverse
|
||||
}
|
||||
|
||||
$obj.pstypenames.Clear()
|
||||
@@ -51,4 +53,4 @@ function New-ConditionalFormattingIconSet {
|
||||
|
||||
$obj
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user