Added try catch for psd1 loading so it can be copy pasted to the console

This commit is contained in:
dfinke
2018-07-04 18:51:25 -04:00
parent a9aeca9550
commit 35553baa05
4 changed files with 26 additions and 18 deletions

View File

@@ -1,6 +1,8 @@
rm temp.xlsx -ErrorAction Ignore
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
$data = invoke-sum (ps) company handles,pm,VirtualMemorySize
Remove-Item temp.xlsx -ErrorAction Ignore
$data = invoke-sum (Get-Process) company handles,pm,VirtualMemorySize
$c = New-ExcelChart -Title Stats `
-ChartType LineMarkersStacked `

View File

@@ -1,4 +1,6 @@
rm temp.xlsx -ErrorAction Ignore
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
Remove-Item temp.xlsx -ErrorAction Ignore
$data = @"
A,B,C,Date

View File

@@ -1,4 +1,6 @@
rm *.xlsx
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
Remove-Item *.xlsx
$data = @"
ID,Product,Quantity,Price,Total

View File

@@ -1,3 +1,5 @@
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
function plot {
param(
$f,
@@ -9,7 +11,7 @@ function plot {
$maxx=[math]::Round($maxx,1)
$file = 'C:\temp\plot.xlsx'
rm $file -ErrorAction Ignore
Remove-Item $file -ErrorAction Ignore
$c = New-ExcelChart -XRange X -YRange Y -ChartType Line -NoLegend -Title Plot -Column 2 -ColumnOffSetPixels 35