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,4 +1,6 @@
#Get rid of pre-exisiting sheet
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
#Get rid of pre-exisiting sheet
$path = "$Env:TEMP\test.xlsx"
remove-item -Path $path -ErrorAction SilentlyContinue

View File

@@ -1,3 +1,4 @@
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
$path = "$env:TEMP\Test.xlsx"
Remove-item -Path $path -ErrorAction SilentlyContinue

View File

@@ -1,15 +1,16 @@
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
$xlfile = "$env:temp\AllSales.xlsx"
Remove-Item $xlfile -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
$params = @{
AutoSize = $true
AutoFilter = $true
AutoNameRange = $true
ExcelChartDefinition = New-ExcelChartDefinition -XRange Item -YRange UnitSold -Title 'Units Sold'
Path = $xlfile
Path = $xlSourcefile
}
#Import 4 sets of sales data from 4 CSV files, using the parameters above.
Import-Csv $PSScriptRoot\NorthSales.csv | Export-Excel -WorkSheetname North @params