Closed mikenelson-io closed 1 year ago
New-Pfa2ExcelReport
requires ImportExcel which is too heavy to be a requirement for other FlashArray cmdlets. New-Pfa2ExcelReport
needs to be rewritten without ImportExcel before moving to FA.
Same for New-Pfa2HypervClusterVolumeReport
, it produces Excel reports.
A classic solution is extraction of Excel support from those cmdlets:
PS> New-Pfa2Report | Export-Excel
PS> New-Pfa2Report | Export-Csv
@mikenelson-io good points on the Reporting. @aguzev when will you handle the migration of Reporting cmdlets into their newly identified modules?
@barkz , @mikenelson-io ,do you agree to drop the dependency on ImportExcel?
By the way, ImportExcel is based on EPPlus which is distributed under Polyform Noncommercial License 1.0.0. I don't know if this might be a concern.
@barkz Legal?
Will follow-up with Pure legal, 4/20/2023.
@aguzev follow-up with work estimate.
I still this issue. Based on comments on #76 ImportExcel dependency was removed. When I look at Reporting module I see:
#Requires -Modules @{ ModuleName='ImportExcel'; ModuleVersion='7.8.4' }
`PS /Users/barkz/Desktop/github-purestorage/powershell-toolkit-3> New-Pfa2ExcelReport -Endpoint 10.21.219.60 -Credential (Get-Credential) -Outpath /users/barkz/Desktop/
PowerShell credential request Enter your credentials. User: pureuser Password for user pureuser: **
Starting to read from array 10.21.219.60 ... Read complete. Disconnecting and continuing... Writing data to Excel workbook... WARNING: Auto-fitting columns is not available with this OS configuration. WARNING: Auto-fitting columns is not available with this OS configuration. No vVol Volume exist on Array. Skipping. WARNING: Auto-fitting columns is not available with this OS configuration. WARNING: Auto-fitting columns is not available with this OS configuration. No Host Groups exist on Array. Skipping. WARNING: Auto-fitting columns is not available with this OS configuration. WARNING: Auto-fitting columns is not available with this OS configuration. No Pods exist on Array. Skipping. Complete. Files located in /users/barkz/Desktop/ `
There should be no reporting module at all. Let me check.
Just pulled
macOS retest after latest PR and pull I get Exchange cim module error. I see in code we require. Can you implement error handling for macOS and Linux?
RequiredModules = @( 'CimCmdlets', 'Storage')
https://learn.microsoft.com/en-us/powershell/scripting/whats-new/unix-support?view=powershell-7.3
The following Windows-specific modules aren't included in PowerShell for Linux or macOS.
Error
PS /Users/barkz/Desktop/github-purestorage/powershell-toolkit-3> ./Import-PureStoragePowerShellToolkit.ps1 Import PureStoragePowerShellToolkit.FlashArray Import PureStoragePowerShellToolkit.DatabaseTools Import PureStoragePowerShellToolkit.WindowsAdministration Import PureStoragePowerShellToolkit.Exchange Import-Module: /Users/barkz/Desktop/github-purestorage/powershell-toolkit-3/Import-PureStoragePowerShellToolkit.Core.ps1:46 Line | 46 | Import-Module ".\$ModuleName" | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | The required module 'CimCmdlets' is not loaded. Load the module or remove the module from 'RequiredModules' in the | file | '/Users/barkz/Desktop/github-purestorage/powershell-toolkit-3/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psd1'.
The output for New-Pfa2ExcelReport has tab order wacky on macOS and Windows.
Windows
macOS
macOS retest after latest PR and pull I get Exchange cim module error. I see in code we require. Can you implement error handling for macOS and Linux?
Exchange module was not designed to be used on MacOS or Linux. It can be used on a Windows Server with Exchange installed.
Exchange module design should be discussed out of this issue.
The output for New-Pfa2ExcelReport has tab order wacky on macOS and Windows.
Yes, currently the order is random.
Import-PureStoragePowerShellToolkit.ps1
imports all toolkit cmdlets including those not running on Unix machines. For Unix users the toolkit provides Import-PureStoragePowerShelltoolkit.Core.ps1
, which imports the cross-platform subset.
Added a fix for tab order: #80
Tab orders fixed for macOS and Windows 11.
For discussion - The New-Pfa2ExcelReport does not require the CimSession cmdlet and therefor can be run on a non-Windows OS such as MacOS as long as it have Excel installed. It should be part of the FlashArray module as it only pertains to FA but will run on multiple OSs. The New-Pfa2HypervClusterVolumeReport does require the CimSession module and since it is only for a Windows based OS, it should be part of the WindowsAdmin module. The Reporting module should then be removed.