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