mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Add scriptblock for Cell Fill Style
This commit is contained in:
15
Examples/FormatCellStyles/PassInScriptBlock.ps1
Normal file
15
Examples/FormatCellStyles/PassInScriptBlock.ps1
Normal file
@@ -0,0 +1,15 @@
|
||||
$RandomStyle = {
|
||||
param(
|
||||
$workSheet,
|
||||
$totalRows,
|
||||
$lastColumn
|
||||
)
|
||||
|
||||
2..$totalRows | ForEach-Object{
|
||||
Set-CellStyle $workSheet $_ $LastColumn Solid (Write-Output LightGreen Gray Red|Get-Random)
|
||||
}
|
||||
}
|
||||
|
||||
Get-Process |
|
||||
Select-Object Company,Handles,PM, NPM|
|
||||
Export-Excel $xlfile -Show -AutoSize -CellStyleSB $RandomStyle
|
||||
Reference in New Issue
Block a user