Standardising examples

This commit is contained in:
MikeyBronowski
2020-07-01 22:04:37 +02:00
parent 0a77a83e35
commit 8a20963577
50 changed files with 249 additions and 154 deletions

View File

@@ -1,25 +1,29 @@
try {Import-Module ..\..\ImportExcel.psd1 -Force} catch {throw ; return}
try {Import-Module ..\..\ImportExcel.psd1 -Force} catch {throw ; return}
$data = $(
New-PSItem 100 @('test', 'testx')
New-PSItem 200
New-PSItem 300
New-PSItem 400
New-PSItem 500
)
$data = $(
New-PSItem 100 @('test', 'testx')
New-PSItem 200
New-PSItem 300
New-PSItem 400
New-PSItem 500
)
$file1 = "$env:Temp\tryComparison1.xlsx"
$file2 = "$env:Temp\tryComparison2.xlsx"
#Get rid of pre-exisiting sheet
$xlSourcefile1 = "$env:TEMP\ImportExcelExample1.xlsx"
$xlSourcefile2 = "$env:TEMP\ImportExcelExample2.xlsx"
Remove-Item -Path $file1 -ErrorAction Ignore
Remove-Item -Path $file2 -ErrorAction Ignore
Write-Verbose -Verbose -Message "Save location: $xlSourcefile1"
Write-Verbose -Verbose -Message "Save location: $xlSourcefile2"
$data | Export-Excel $file1 -Show -ConditionalText $(
New-ConditionalText -ConditionalType GreaterThan 300
New-ConditionalText -ConditionalType LessThan 300 -BackgroundColor cyan
)
Remove-Item $xlSourcefile1 -ErrorAction Ignore
Remove-Item $xlSourcefile2 -ErrorAction Ignore
$data | Export-Excel $file2 -Show -ConditionalText $(
New-ConditionalText -ConditionalType GreaterThanOrEqual 275
New-ConditionalText -ConditionalType LessThanOrEqual 250 -BackgroundColor cyan
)
$data | Export-Excel $xlSourcefile1 -Show -ConditionalText $(
New-ConditionalText -ConditionalType GreaterThan 300
New-ConditionalText -ConditionalType LessThan 300 -BackgroundColor cyan
)
$data | Export-Excel $xlSourcefile2 -Show -ConditionalText $(
New-ConditionalText -ConditionalType GreaterThanOrEqual 275
New-ConditionalText -ConditionalType LessThanOrEqual 250 -BackgroundColor cyan
)