/
diev
/
dfinke-ImportExcel
Обзор
Документация
Войти
/
diev
/
dfinke-ImportExcel
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Examples/ConditionalFormatting/RangeFormatting.ps1
21 строка
849 B
MikeyBronowski
Standardising examples
01 июл 2020, 23:04
01 июл 2020, 23:04
8a20963
Код
Авторство
О чём код?
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return} #Get rid of pre-exisiting sheet $xlSourcefile = "$env:TEMP\ImportExcelExample.xlsx" Write-Verbose -Verbose -Message "Save location: $xlSourcefile" Remove-Item $xlSourcefile -ErrorAction Ignore function Get-DateOffset ($days=0) { (Get-Date).AddDays($days).ToShortDateString() } $( New-PSItem (Get-DateOffset -1) (Get-DateOffset 1) @("Start", "End") New-PSItem (Get-DateOffset) (Get-DateOffset 7) New-PSItem (Get-DateOffset -10) (Get-DateOffset -1) ) | Export-Excel $xlSourcefile -Show -AutoSize -AutoNameRange -ConditionalText $( New-ConditionalText -Range Start -ConditionalType Yesterday -ConditionalTextColor Red New-ConditionalText -Range End -ConditionalType Yesterday -BackgroundColor Blue -ConditionalTextColor Red )