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

@@ -364,4 +364,18 @@ Describe "Import-Excel on a sheet with no headings" {
$actual[0].E | Should -Be '5'
}
It "Should arrange the columns if -ImportColumns is not in order" {
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(5,1,4))
$actualNames = $actual[0].psobject.properties.Name
$actualNames.Count | Should -Be 3
$actualNames[0] | Should -Be 'E'
$actualNames[1] | Should -Be 'A'
$actualNames[2] | Should -Be 'D'
$actual[0].E | Should -Be '5'
$actual[0].A | Should -Be '1'
$actual[0].D | Should -Be '4'
}
}