Add scriptblock for Cell Fill Style

This commit is contained in:
dfinke
2016-12-22 11:24:18 -05:00
parent 374010c7f6
commit 29e44e0aa1
7 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
Get-Process |
Select-Object Company,Handles,PM, NPM|
Export-Excel $xlfile -Show -AutoSize -CellStyleSB {
param(
$workSheet,
$totalRows,
$lastColumn
)
Set-CellStyle $workSheet 1 $LastColumn Solid Cyan
foreach($row in (2..$totalRows | Where-Object {$_ % 2 -eq 0})) {
Set-CellStyle $workSheet $row $LastColumn Solid Gray
}
foreach($row in (2..$totalRows | Where-Object {$_ % 2 -eq 1})) {
Set-CellStyle $workSheet $row $LastColumn Solid LightGray
}
}