From 446063a114d9dcd42c7760081d2f845805b21633 Mon Sep 17 00:00:00 2001 From: Aleksei Guzev Date: Wed, 3 May 2023 23:26:34 +0300 Subject: [PATCH] Fix Excel tab order --- ...toragePowerShellToolkit.DatabaseTools.psd1 | 2 +- ...reStoragePowerShellToolkit.FlashArray.psm1 | 24 +++++++++---------- ...werShellToolkit.WindowsAdministration.psm1 | 8 +++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psd1 b/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psd1 index b9c0c97..7ade540 100644 --- a/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psd1 +++ b/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psd1 @@ -75,7 +75,7 @@ RequiredModules = @( }, @{ ModuleName = 'dbatools' - ModuleVersion = '1.1.146' + ModuleVersion = '1.0.173' } ) diff --git a/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psm1 b/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psm1 index 8f1224d..eafb3ef 100644 --- a/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psm1 +++ b/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psm1 @@ -489,7 +489,7 @@ function Export-Pfa2Excel { [CmdletBinding()] param( [Parameter(ValueFromPipeline)] - [hashtable]$Tables, + [System.Collections.IDictionary]$Tables, [Parameter(Mandatory)] [string]$LiteralPath ) @@ -568,9 +568,9 @@ function Export-Pfa2Excel { } $items = @(foreach($valueItem in $valueArray) { - $ht = @{} + $ht = [ordered]@{} - $( if ($valueItem -is [hashtable]) { $valueItem.GetEnumerator() } else { $valueItem.PSObject.Properties } ) | + $( if ($valueItem -is [System.Collections.IDictionary]) { $valueItem.GetEnumerator() } else { $valueItem.PSObject.Properties } ) | ForEach-Object { $value = if(($null -eq $_.Value) -or $dataTypes.ContainsKey($_.Value.GetType())) { $_.Value } else {[string]$_.Value} $ht.Add($_.Name, $value ) @@ -3201,10 +3201,10 @@ function New-Pfa2ExcelReport { $excelFile = Join-Path $OutPath "$($array_details.name)-$date.xlsx" Write-Host 'Writing data to Excel workbook...' -ForegroundColor green - $report = @{} + $report = [ordered]@{} # Array Information - $report['Array_Info'] = @( @{ + $report['Array_Info'] = @( [ordered]@{ 'Array Name' = ($array_details.Name).ToUpper() 'Array ID' = $array_details.Id 'Purity Version' = $array_details.Version @@ -3224,7 +3224,7 @@ function New-Pfa2ExcelReport { ## Volume Details $details = $volumes | ForEach-Object { - @{ + [ordered]@{ 'Name' = $_.Name 'Size(GB)' = Convert-UnitOfSize $_.provisioned -To 1GB 'Unique Data(GB)' = Convert-UnitOfSize $_.space.Unique -To 1GB @@ -3269,7 +3269,7 @@ function New-Pfa2ExcelReport { ## Volume Snapshot details if ($snapshots) { $report['Volume Snapshots'] = $snapshots | ForEach-Object { - @{ + [ordered]@{ 'Name' = $_.Name 'Created' = $_.Created 'Provisioned(GB)' = Convert-UnitOfSize $_.Provisioned -To 1GB @@ -3286,7 +3286,7 @@ function New-Pfa2ExcelReport { # Host Details if ($host_details) { $report['Hosts'] = $host_details | ForEach-Object { - @{ + [ordered]@{ 'Name' = $_.Name 'No. of Volumes' = $_.ConnectionCount 'HostGroup' = $_.HostGroup.Name @@ -3302,7 +3302,7 @@ function New-Pfa2ExcelReport { ## HostGroup Details if ($hostgroup) { $report['Host Groups'] = $hostgroup | ForEach-Object { - @{ + [ordered]@{ 'Name' = $_.Name 'HostCount' = $_.HostCount 'No. of Volumes' = $_.ConnectionCount @@ -3316,7 +3316,7 @@ function New-Pfa2ExcelReport { ## Protection Group and Protection Group Transfer details if ($pgd) { $report['Protection Groups'] = $pgd | ForEach-Object { - @{ + [ordered]@{ 'Name' = $_.Name 'Snapshot Size(GB)' = Convert-UnitOfSize $_.space.snapshots -To 1GB 'VolumeCount' = $_.VolumeCount @@ -3329,7 +3329,7 @@ function New-Pfa2ExcelReport { if ($pgst) { $report['PG Snapshot Transfers'] = $pgst | ForEach-Object { - @{ + [ordered]@{ 'Name' = $_.Name 'Data Transferred(MB)' = Convert-UnitOfSize $_.DataTransferred -To 1MB 'Destroyed' = $_.Destroyed @@ -3344,7 +3344,7 @@ function New-Pfa2ExcelReport { ## Pod details if ($pods) { $report['Pods'] = $pods | ForEach-Object { - @{ + [ordered]@{ 'Name' = $_.Name 'ArrayCount' = $_.ArrayCount 'Source' = $_.source.name diff --git a/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psm1 b/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psm1 index 0a8d0a5..efccaa3 100644 --- a/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psm1 +++ b/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psm1 @@ -761,7 +761,7 @@ function New-Pfa2HypervClusterVolumeReport() { } } - $report = @{} + $report = [ordered]@{} #Get VMs & VHDs $nodes = Get-ClusterNode @@ -769,7 +769,7 @@ function New-Pfa2HypervClusterVolumeReport() { ForEach-Object { $_ } -PipelineVariable 'vm' | ForEach-Object { Get-Vhd -ComputerName $_.ComputerName -VmId $_.VmId } | ForEach-Object { - [pscustomobject]@{ + [pscustomobject][ordered]@{ 'VM Name' = $vm.Name 'VM State' = $vm.State 'ComputerName' = $_.ComputerName @@ -796,7 +796,7 @@ function New-Pfa2HypervClusterVolumeReport() { } | Where-Object DriveType -eq Fixed | ForEach-Object { - [pscustomobject]@{ + [pscustomobject][ordered]@{ 'ComputerName' = $node.Name 'Label' = $_.FileSystemLabel 'Name' = if ($_.DriveLetter) { "$($_.DriveLetter):\" } else { $_.Path } @@ -844,7 +844,7 @@ function New-Pfa2HypervClusterVolumeReport() { Where-Object { $sn -contains $_.serial } | Select-Object 'Name' -ExpandProperty 'Space' | ForEach-Object { - [pscustomobject]@{ + [pscustomobject][ordered]@{ 'Array' = $details.Name 'Name' = $_.Name 'Size (GB)' = Convert-UnitOfSize $_.TotalProvisioned -To 1GB