Updated scripts

Added -Header parameter and scoped the header variable in the
Export-Excel command
This commit is contained in:
dfinke
2016-03-02 18:03:00 -05:00
parent 22326e8ee4
commit e9b8deccf5
6 changed files with 33 additions and 16 deletions

View File

@@ -1,8 +1,10 @@
function Import-Html {
[CmdletBinding()]
param(
$url,
$index
$index,
$Header
)
$xlFile = [System.IO.Path]::GetTempFileName() -replace "tmp","xlsx"
@@ -10,6 +12,7 @@ function Import-Html {
Write-Verbose "Exporting to Excel file $($xlFile)"
Get-HtmlTable $url $index |
Export-Excel $xlFile -Show -AutoSize
$data = Get-HtmlTable -url $url -tableIndex $index -Header $Header
$data | Export-Excel $xlFile -Show -AutoSize
}