@@ -489,7 +489,7 @@ function Export-Pfa2Excel {
489489 [CmdletBinding ()]
490490 param (
491491 [Parameter (ValueFromPipeline )]
492- [hashtable ]$Tables ,
492+ [System.Collections.IDictionary ]$Tables ,
493493 [Parameter (Mandatory )]
494494 [string ]$LiteralPath
495495 )
@@ -568,9 +568,9 @@ function Export-Pfa2Excel {
568568 }
569569
570570 $items = @ (foreach ($valueItem in $valueArray ) {
571- $ht = @ {}
571+ $ht = [ ordered ] @ {}
572572
573- $ ( if ($valueItem -is [hashtable ]) { $valueItem.GetEnumerator () } else { $valueItem.PSObject.Properties } ) |
573+ $ ( if ($valueItem -is [System.Collections.IDictionary ]) { $valueItem.GetEnumerator () } else { $valueItem.PSObject.Properties } ) |
574574 ForEach-Object {
575575 $value = if (($null -eq $_.Value ) -or $dataTypes.ContainsKey ($_.Value.GetType ())) { $_.Value } else {[string ]$_.Value }
576576 $ht.Add ($_.Name , $value )
@@ -3201,10 +3201,10 @@ function New-Pfa2ExcelReport {
32013201 $excelFile = Join-Path $OutPath " $ ( $array_details.name ) -$date .xlsx"
32023202 Write-Host ' Writing data to Excel workbook...' - ForegroundColor green
32033203
3204- $report = @ {}
3204+ $report = [ ordered ] @ {}
32053205
32063206 # Array Information
3207- $report [' Array_Info' ] = @ ( @ {
3207+ $report [' Array_Info' ] = @ ( [ ordered ] @ {
32083208 ' Array Name' = ($array_details.Name ).ToUpper()
32093209 ' Array ID' = $array_details.Id
32103210 ' Purity Version' = $array_details.Version
@@ -3224,7 +3224,7 @@ function New-Pfa2ExcelReport {
32243224
32253225 # # Volume Details
32263226 $details = $volumes | ForEach-Object {
3227- @ {
3227+ [ ordered ] @ {
32283228 ' Name' = $_.Name
32293229 ' Size(GB)' = Convert-UnitOfSize $_.provisioned - To 1 GB
32303230 ' Unique Data(GB)' = Convert-UnitOfSize $_.space.Unique - To 1 GB
@@ -3269,7 +3269,7 @@ function New-Pfa2ExcelReport {
32693269 # # Volume Snapshot details
32703270 if ($snapshots ) {
32713271 $report [' Volume Snapshots' ] = $snapshots | ForEach-Object {
3272- @ {
3272+ [ ordered ] @ {
32733273 ' Name' = $_.Name
32743274 ' Created' = $_.Created
32753275 ' Provisioned(GB)' = Convert-UnitOfSize $_.Provisioned - To 1 GB
@@ -3286,7 +3286,7 @@ function New-Pfa2ExcelReport {
32863286 # Host Details
32873287 if ($host_details ) {
32883288 $report [' Hosts' ] = $host_details | ForEach-Object {
3289- @ {
3289+ [ ordered ] @ {
32903290 ' Name' = $_.Name
32913291 ' No. of Volumes' = $_.ConnectionCount
32923292 ' HostGroup' = $_.HostGroup.Name
@@ -3302,7 +3302,7 @@ function New-Pfa2ExcelReport {
33023302 # # HostGroup Details
33033303 if ($hostgroup ) {
33043304 $report [' Host Groups' ] = $hostgroup | ForEach-Object {
3305- @ {
3305+ [ ordered ] @ {
33063306 ' Name' = $_.Name
33073307 ' HostCount' = $_.HostCount
33083308 ' No. of Volumes' = $_.ConnectionCount
@@ -3316,7 +3316,7 @@ function New-Pfa2ExcelReport {
33163316 # # Protection Group and Protection Group Transfer details
33173317 if ($pgd ) {
33183318 $report [' Protection Groups' ] = $pgd | ForEach-Object {
3319- @ {
3319+ [ ordered ] @ {
33203320 ' Name' = $_.Name
33213321 ' Snapshot Size(GB)' = Convert-UnitOfSize $_.space.snapshots - To 1 GB
33223322 ' VolumeCount' = $_.VolumeCount
@@ -3329,7 +3329,7 @@ function New-Pfa2ExcelReport {
33293329
33303330 if ($pgst ) {
33313331 $report [' PG Snapshot Transfers' ] = $pgst | ForEach-Object {
3332- @ {
3332+ [ ordered ] @ {
33333333 ' Name' = $_.Name
33343334 ' Data Transferred(MB)' = Convert-UnitOfSize $_.DataTransferred - To 1 MB
33353335 ' Destroyed' = $_.Destroyed
@@ -3344,7 +3344,7 @@ function New-Pfa2ExcelReport {
33443344 # # Pod details
33453345 if ($pods ) {
33463346 $report [' Pods' ] = $pods | ForEach-Object {
3347- @ {
3347+ [ ordered ] @ {
33483348 ' Name' = $_.Name
33493349 ' ArrayCount' = $_.ArrayCount
33503350 ' Source' = $_.source.name
0 commit comments