Add example and automatic column arrangement

Add example and automatic column arrangement
This commit is contained in:
muschebubusche
2021-11-07 22:52:54 +01:00
parent 62c8d74a59
commit 8f0fc7397d
3 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
# Create example file
$xlFile = "$PSScriptRoot\ImportColumns.xlsx"
Get-Process | Export-Excel -Path $xlFile
# -ImportColumns will also arrange columns
Import-Excel -Path $xlFile -ImportColumns @(1,3,2) -NoHeader -StartRow 1
# Get only pm, npm, cpu, id, processname
Import-Excel -Path $xlFile -ImportColumns @(6,7,12,25,46) | Format-Table -AutoSize