mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-10 21:33:16 +00:00
18 lines
644 B
PowerShell
18 lines
644 B
PowerShell
ipmo ImportExcel -Force
|
|
$f = ".\testExport.xlsx"
|
|
rm $f -ErrorAction Ignore
|
|
|
|
function Get-DateOffset ($days=0) {
|
|
(Get-Date).AddDays($days).ToShortDateString()
|
|
}
|
|
|
|
$(
|
|
New-PSItem (Get-DateOffset -1) (Get-DateOffset 1) (echo Start End)
|
|
New-PSItem (Get-DateOffset) (Get-DateOffset 7)
|
|
New-PSItem (Get-DateOffset -10) (Get-DateOffset -1)
|
|
) |
|
|
|
|
Export-Excel $f -Show -AutoSize -AutoNameRange -ConditionalText $(
|
|
New-ConditionalText -Range Start -ConditionalType Yesterday -ConditionalTextColor Red
|
|
New-ConditionalText -Range End -ConditionalType Yesterday -BackgroundColor Blue -ConditionalTextColor Red
|
|
) |