From 2ff98d1de5a7f92850eafb41bb384214d108c8cf Mon Sep 17 00:00:00 2001 From: dfinke Date: Wed, 24 Feb 2016 11:06:48 -0500 Subject: [PATCH] Call .NET for temp files --- Charting.ps1 | 2 +- Get-HtmlTable.ps1 | 2 +- Import-Html.ps1 | 2 +- ImportExcel.psd1 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Charting.ps1 b/Charting.ps1 index 7cbac92..17c6ee1 100644 --- a/Charting.ps1 +++ b/Charting.ps1 @@ -23,7 +23,7 @@ function DoChart { -NoLegend:$NoLegend -ShowCategory:$ShowCategory -ShowPercent:$ShowPercent } - $xlFile = (New-TemporaryFile).fullname -replace "tmp","xlsx" + $xlFile = [System.IO.Path]::GetTempFileName() -replace "tmp","xlsx" $targetData | Export-Excel $xlFile -ExcelChartDefinition $chart -Show -AutoSize } diff --git a/Get-HtmlTable.ps1 b/Get-HtmlTable.ps1 index 8dfb333..16d0988 100644 --- a/Get-HtmlTable.ps1 +++ b/Get-HtmlTable.ps1 @@ -5,7 +5,7 @@ function Get-HtmlTable { $tableIndex=0 ) - $r = (Invoke-WebRequest $url) + $r = Invoke-WebRequest $url $table = $r.ParsedHtml.getElementsByTagName("table")[$tableIndex] $propertyNames = @() $totalRows=@($table.rows).count-1 diff --git a/Import-Html.ps1 b/Import-Html.ps1 index 6998f02..83cadd8 100644 --- a/Import-Html.ps1 +++ b/Import-Html.ps1 @@ -5,7 +5,7 @@ function Import-Html { $index ) - $xlFile = (New-TemporaryFile).fullname -replace "tmp","xlsx" + $xlFile = [System.IO.Path]::GetTempFileName() -replace "tmp","xlsx" rm $xlFile -ErrorAction Ignore Write-Verbose "Exporting to Excel file $($xlFile)" diff --git a/ImportExcel.psd1 b/ImportExcel.psd1 index b87db95..bccbb87 100644 --- a/ImportExcel.psd1 +++ b/ImportExcel.psd1 @@ -4,7 +4,7 @@ RootModule = 'ImportExcel.psm1' # Version number of this module. -ModuleVersion = '2.1' +ModuleVersion = '2.1.0' # ID used to uniquely identify this module GUID = '60dd4136-feff-401a-ba27-a84458c57ede'