mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-13 06:43:17 +00:00
11 lines
454 B
PowerShell
11 lines
454 B
PowerShell
try { Import-Module $PSScriptRoot\..\..\ImportExcel.psd1 } catch { throw ; return}
|
|
|
|
$xlSourcefile = "$env:TEMP\ImportExcelExample.xlsx"
|
|
$excel = Open-ExcelPackage -Path $xlSourcefile
|
|
|
|
$excel.Workbook.Worksheets | ForEach-Object {
|
|
$_.ConditionalFormatting | ForEach-Object {
|
|
Write-Host "Add-ConditionalFormatting -Worksheet `$excel[""$worksheetName""] -Range '$($_.Address)' -ConditionValue '$($_.Formula)' -RuleType $($_.Type) "
|
|
}
|
|
}
|