mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
21 lines
522 B
PowerShell
21 lines
522 B
PowerShell
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
|
|
|
|
$xlfile = "$env:temp\testFmt.xlsx"
|
|
Remove-Item $xlfile -ErrorAction Ignore
|
|
|
|
$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
|