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,6 +1,9 @@
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
Remove-Item -Path .\test.xlsx -ErrorAction Ignore
#Get rid of pre-exisiting sheet
$xlSourcefile = "$env:TEMP\ImportExcelExample.xlsx"
Write-Verbose -Verbose -Message "Save location: $xlSourcefile"
Remove-Item $xlSourcefile -ErrorAction Ignore
$excel = @"
Month,Sales
@@ -11,7 +14,7 @@ Apr,952
May,770
Jun,621
"@ | ConvertFrom-csv |
Export-Excel -Path .\test.xlsx -WorkSheetname Sheet1 -AutoNameRange -PassThru
Export-Excel -Path $xlSourcefile -WorkSheetname Sheet1 -AutoNameRange -PassThru
$sheet = $excel.Workbook.Worksheets["Sheet1"]
Add-ConditionalFormatting -Worksheet $sheet -Range "B1:B7" -DataBarColor LawnGreen