Icon sets

This commit is contained in:
dfinke
2015-08-02 15:25:35 -04:00
parent 1b775ac5b9
commit 92dffa1785
2 changed files with 18 additions and 3 deletions

View File

@@ -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

View File

@@ -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
}
}
}