Skip to content

Commit 66bf3ad

Browse files
author
jhoneill
committed
remove LoadPSD calls & 72 empty catch blocks from examples
1 parent 36f27e3 commit 66bf3ad

File tree

73 files changed

+73
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+73
-76
lines changed

Examples/AddWorkSheet/AddMultiWorkSheet.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlSourcefile = "$env:TEMP\Source.xlsx"
44
write-host "Save location: $xlSourcefile"
55

66
Remove-Item $xlSourcefile -ErrorAction Ignore
77

88
#Put some simple data in a worksheet and Get an excel package object to represent the file
9-
$TabData1 = 1..5 | Export-Excel $xlSourcefile -WorksheetName 'Tab 1' -AutoSize -AutoFilter
9+
$TabData1 = 1..5 | Export-Excel $xlSourcefile -WorksheetName 'Tab1' -AutoSize -AutoFilter
1010

1111
#Add another tab. Replace the $TabData2 with your data
1212
$TabData2 = 1..10 | Export-Excel $xlSourcefile -WorksheetName 'Tab 2' -AutoSize -AutoFilter

Examples/AddWorkSheet/AddWorkSheet.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlSourcefile = "$env:TEMP\Source.xlsx"
44

Examples/Charts/MultiSeries.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Remove-Item temp.xlsx -ErrorAction Ignore
44

Examples/Charts/MultiSeries1.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Remove-Item temp.xlsx -ErrorAction Ignore
44

Examples/Charts/MultipleCharts.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Remove-Item -Path Tools.xlsx
44

Examples/Charts/plot.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
function plot {
44
param(

Examples/ConditionalFormatting/ConditionalText.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$file = "$env:temp\conditionalTextFormatting.xlsx"
44
Remove-Item $file -ErrorAction Ignore

Examples/ConditionalFormatting/ContainsBlanks.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
#Define a "Contains blanks" rule. No format is specified so it default to dark-red text on light-pink background.
44
$ContainsBlanks = New-ConditionalText -ConditionalType ContainsBlanks

Examples/ConditionalFormatting/Databar.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$path = "$env:temp\test.xlsx"
44
Remove-Item -Path $path -ErrorAction Ignore

Examples/ConditionalFormatting/FormatCalculations.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = "$env:TEMP\testExport.xlsx"
44

Examples/ConditionalFormatting/GetProcess.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Remove-Item "$env:TEMP\testExport.xlsx" -ErrorAction Ignore
44

Examples/ConditionalFormatting/Highlight-Last7Days.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-LastMonth.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-LastWeek.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-NextMonth.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-NextWeek.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-ThisMonth.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-ThisWeek.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-Today.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-Tomorrow.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/Highlight-Yesterday.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/HighlightDuplicates.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44

Examples/ConditionalFormatting/MonthlyTemperatuesDatabar.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Remove-Item -Path .\test.xlsx -ErrorAction Ignore
44

Examples/ConditionalFormatting/RangeFormatting.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = ".\testExport.xlsx"
44
Remove-Item $f -ErrorAction Ignore

Examples/ConditionalFormatting/SalesReportWithDatabar.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Remove-Item -Path .\test.xlsx -ErrorAction Ignore
44

Examples/ConvertFrom/ConvertFrom.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
ConvertFrom-ExcelToSQLInsert People .\testSQLGen.xlsx
44

Examples/CustomReporting/CustomReport.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$f = "$env:temp\dashboard.xlsx"
44
Remove-Item $f -ErrorAction Ignore

Examples/ExcelDataValidation/MutipleValidations.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Add .01 in column F
1414
#>
1515

16-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
16+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
1717

1818
$path = "$Env:TEMP\DataValidation.xlsx"
1919
Remove-Item $path -ErrorAction SilentlyContinue

Examples/ExcelToSQLInsert/DemoSQLInsert.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
ConvertFrom-ExcelToSQLInsert -TableName "Movies" -Path ".\Movies.xlsx" -ConvertEmptyStringsToNull
44
''

Examples/Fibonacci/ShowFibonacci.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
param ($fibonacciDigits=10)
22

3-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
3+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
44

55
$file = "fib.xlsx"
66
Remove-Item "fib.xlsx" -ErrorAction Ignore

Examples/FormatCellStyles/ApplyFormatInScriptBlock.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlfile = "$env:temp\testFmt.xlsx"
44

Examples/FormatCellStyles/PassInScriptBlock.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlfile = "$env:temp\testFmt.xlsx"
44
Remove-Item $xlfile -ErrorAction Ignore

Examples/HyperLinks/Hyperlinks.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
@"
44
site,link

Examples/ImportHtml/DemoGraphics.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33

44
Import-Html "http://en.wikipedia.org/wiki/Demographics_of_India" 4
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Import-Html "http://www.science.co.il/PTelements.asp" 1

Examples/ImportHtml/StarTrek.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Import-Html "https://en.wikipedia.org/wiki/List_of_Star_Trek:_The_Original_Series_episodes" 2

Examples/JoinWorksheet/JoinSalesData.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlfile = "$env:temp\AllSales.xlsx"
44

Examples/JustCharts/CentralLimitTheorem.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
ColumnChart -Title "Central Limit Theorem" -NoLegend ($(
44
for ($i = 1; $i -le 500; $i++) {

Examples/JustCharts/PieChartHandles.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Sum up handles by company
33
# Show the Pie Chart
44

5-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
5+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
66

77
PieChart -Title "Total Handles by Company" `
88
(Invoke-Sum (Get-Process | Where-Object company) company handles)

Examples/JustCharts/PieChartPM.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Sum up PM by company
33
# Show the Pie Chart
44

5-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
5+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
66

77
PieChart -Title "Total PM by Company" `
88
(Invoke-Sum (Get-Process|Where-Object company) company pm)

Examples/JustCharts/TryBarChart.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
BarChart (.\TargetData.ps1) "A BarChart"
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
ColumnChart (.\TargetData.ps1) "A ColumnChart"

Examples/JustCharts/TryPieChart.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
PieChart (.\TargetData.ps1) "A PieChart"

Examples/MergeWorkSheet/MergeCSV.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlFile = "$env:TEMP\mw.xlsx"
44

Examples/MoveSheets/MoveSheets.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlfile = "$env:TEMP\testThis.xlsx"
44
Remove-Item $xlfile -ErrorAction Ignore

Examples/Nasa/FireBalls.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$header = echo `
44
'Date/Time - Peak Brightness (UT)' `

Examples/NumberFormat/ColorizeNumbers.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$file = "$env:TEMP\disks.xlsx"
44

Examples/NumberFormat/CurrencyFormat.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$file = "$env:temp\disks.xlsx"
44

Examples/NumberFormat/PercentagFormat.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$file = "disks.xlsx"
44

Examples/NumberFormat/PosNegNumbers.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$file = "disks.xlsx"
44

Examples/NumberFormat/Win32LogicalDisk.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$file = "disks.xlsx"
44

Examples/NumberFormat/Win32LogicalDiskFormatted.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$file = "disks.xlsx"
44

Examples/PassThru/TryPassThru.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$file = "$env:Temp\sales.xlsx"
44

Examples/PivotTable/PivotTableWithName.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$ExcelParams = @{
44
Path = "$env:TEMP\test1.xlsx"

Examples/PivotTableFilters/testPivotFilter.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlFile="$env:TEMP\testPivot.xlsx"
44
Remove-Item $xlFile -ErrorAction Ignore

Examples/Plot/PlotCos.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$plt = New-Plot
44
$plt.Plot((Get-Range 0 5 .02|Foreach-Object {[math]::Cos(2*[math]::pi*$_)}))

Examples/SQL+FillColumns+Pivot/Example.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$sql = @"
44
SELECT rootfile.baseName , rootfile.extension , Image.fileWidth AS width , image.fileHeight AS height ,

Examples/SQL+FillColumns+Pivot/Example2.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#requires -modules "getSql"
22

3-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
3+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
44
#download f1Results from https://1drv.ms/f/s!AhfYu7-CJv4egbt5FD7Cdxi8jSz3aQ and update the path below
55
Get-SQL -Session f1 -Excel -Connection C:\Users\mcp\OneDrive\Public\F1\f1Results.xlsx -showtables -Verbose
66

Examples/SetColumnBackgroundColor/SetColumnBackgroundColor.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$path = "$env:TEMP\testBackgroundColor.xlsx"
44

Examples/Sparklines/SalesByQuarter.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try { . $PSScriptRoot\..\..\LoadPSD1.ps1 } catch { }
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
$xlfile = "$env:TEMP\SalesByQuarter.xlsx"
44
Remove-Item $xlfile -ErrorAction SilentlyContinue

Examples/Sparklines/Sparklines.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try { . $PSScriptRoot\..\..\LoadPSD1.ps1 } catch { }
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
class data {
44
[datetime]$Date

Examples/SpreadsheetCells/CalculatedFields.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33

44
#. ..\New-PSItem.ps1

Examples/SpreadsheetCells/ExcelFormulasUsingAddMember.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
1+
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
22

33
Remove-Item .\testFormula.xlsx -ErrorAction Ignore
44

0 commit comments

Comments
 (0)