diff --git a/Import-PureStoragePowerShellToolkit.ps1 b/Import-PureStoragePowerShellToolkit.ps1 index 1aba3f7..21a8ecc 100644 --- a/Import-PureStoragePowerShellToolkit.ps1 +++ b/Import-PureStoragePowerShellToolkit.ps1 @@ -1,5 +1,4 @@ . $PSScriptRoot\Import-PureStoragePowerShellToolkit.Core.ps1 'PureStoragePowerShellToolkit.WindowsAdministration', -'PureStoragePowerShellToolkit.Reporting', 'PureStoragePowerShellToolkit.Exchange' | Import-ModuleManually diff --git a/PureStoragePowerShellToolkit.Core/PureStoragePowerShellToolkit.Core.psd1 b/PureStoragePowerShellToolkit.Core/PureStoragePowerShellToolkit.Core.psd1 index 14bec43..bd9dbc4 100644 --- a/PureStoragePowerShellToolkit.Core/PureStoragePowerShellToolkit.Core.psd1 +++ b/PureStoragePowerShellToolkit.Core/PureStoragePowerShellToolkit.Core.psd1 @@ -29,7 +29,7 @@ # Version number of this module. -ModuleVersion = '3.0.0.3' +ModuleVersion = '3.0.1' # Supported PSEditions #CompatiblePSEditions = @("Desktop", "Core") @@ -71,11 +71,11 @@ ProcessorArchitecture = '' RequiredModules = @( @{ ModuleName = 'PureStoragePowerShellToolkit.DatabaseTools' - ModuleVersion = '3.0.0.3' + ModuleVersion = '3.0.1' }, @{ ModuleName = 'PureStoragePowerShellToolkit.FlashArray' - Moduleversion = '3.0.0.3' + Moduleversion = '3.0.1' } ) diff --git a/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psd1 b/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psd1 index 39b259c..b9c0c97 100644 --- a/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psd1 +++ b/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psd1 @@ -29,7 +29,7 @@ RootModule = 'PureStoragePowerShellToolkit.DatabaseTools.psm1' # Version number of this module. -ModuleVersion = '3.0.0.3' +ModuleVersion = '3.0.1' # Supported PSEditions #CompatiblePSEditions = @("Desktop", "Core") @@ -71,11 +71,11 @@ ProcessorArchitecture = '' RequiredModules = @( @{ ModuleName = 'PureStoragePowerShellToolkit.FlashArray' - ModuleVersion = '3.0.0.3' + ModuleVersion = '3.0.1' }, @{ ModuleName = 'dbatools' - ModuleVersion = '1.0.173' + ModuleVersion = '1.1.146' } ) diff --git a/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psm1 b/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psm1 index ef5e2db..1fce738 100644 --- a/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psm1 +++ b/PureStoragePowerShellToolkit.DatabaseTools/PureStoragePowerShellToolkit.DatabaseTools.psm1 @@ -1,6 +1,6 @@ <# =========================================================================== - Release version: 3.0.0 + Release version: 3.0.1 Revision information: Refer to the changelog.md file --------------------------------------------------------------------------- Maintained by: FlashArray Integrations and Evangelsigm Team @ Pure Storage @@ -20,7 +20,7 @@ #> #Requires -Version 5 -#Requires -Modules @{ ModuleName='PureStoragePowerShellToolkit.FlashArray'; ModuleVersion='3.0.0.3' } +#Requires -Modules @{ ModuleName='PureStoragePowerShellToolkit.FlashArray'; ModuleVersion='3.0.1' } #Requires -Modules @{ ModuleName='dbatools'; ModuleVersion='1.0.173' } #region Helper functions diff --git a/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psd1 b/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psd1 index 773c5e9..990721b 100644 Binary files a/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psd1 and b/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psd1 differ diff --git a/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psm1 b/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psm1 index 4a43e9a..a8e3f89 100644 --- a/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psm1 +++ b/PureStoragePowerShellToolkit.Exchange/PureStoragePowerShellToolkit.Exchange.psm1 @@ -1,6 +1,6 @@ <# =========================================================================== - Release version: 3.0.0 + Release version: 3.0.1 Revision information: Refer to the changelog.md file --------------------------------------------------------------------------- Maintained by: FlashArray Integrations and Evangelsigm Team @ Pure Storage diff --git a/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psd1 b/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psd1 index 1c36855..81979d5 100644 --- a/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psd1 +++ b/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psd1 @@ -29,7 +29,7 @@ RootModule = 'PureStoragePowerShellToolkit.FlashArray.psm1' # Version number of this module. -ModuleVersion = '3.0.0.3' +ModuleVersion = '3.0.1' # Supported PSEditions #CompatiblePSEditions = @("Desktop", "Core") diff --git a/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psm1 b/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psm1 index 173f270..8f1224d 100644 --- a/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psm1 +++ b/PureStoragePowerShellToolkit.FlashArray/PureStoragePowerShellToolkit.FlashArray.psm1 @@ -1,6 +1,6 @@ <# =========================================================================== - Release version: 3.0.0 + Release version: 3.0.1 Revision information: Refer to the changelog.md file --------------------------------------------------------------------------- Maintained by: FlashArray Integrations and Evangelsigm Team @ Pure Storage diff --git a/PureStoragePowerShellToolkit.Reporting/LICENSE b/PureStoragePowerShellToolkit.Reporting/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/PureStoragePowerShellToolkit.Reporting/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/PureStoragePowerShellToolkit.Reporting/PureStoragePowerShellToolkit.Reporting.psd1 b/PureStoragePowerShellToolkit.Reporting/PureStoragePowerShellToolkit.Reporting.psd1 deleted file mode 100644 index 759b162..0000000 --- a/PureStoragePowerShellToolkit.Reporting/PureStoragePowerShellToolkit.Reporting.psd1 +++ /dev/null @@ -1,161 +0,0 @@ -<# - =========================================================================== - Created by: FlashArray Integrations and Evangelism Team @ Pure Storage - Organization: Pure Storage, Inc. - Filename: PureStoragePowerShellToolkit.Reporting.psd1 - Copyright: (c) 2023 Pure Storage, Inc. - Module Name: PureStoragePowerShellToolkit.Reporting - Description: PowerShell Script Module Manifest (.psd1) - ------------------------------------------------------------------------- - Disclaimer - The sample script and documentation are provided AS IS and are not supported by - the author or the author's employer, unless otherwise agreed in writing. You bear - all risk relating to the use or performance of the sample script and documentation. - The author and the author's employer disclaim all express or implied warranties - (including, without limitation, any warranties of merchantability, title, infringement - or fitness for a particular purpose). In no event shall the author, the author's employer - or anyone else involved in the creation, production, or delivery of the scripts be liable - for any damages whatsoever arising out of the use or performance of the sample script and - documentation (including, without limitation, damages for loss of business profits, - business interruption, loss of business information, or other pecuniary loss), even if - such person has been advised of the possibility of such damages. - =========================================================================== -#> - -@{ - -# Script module or binary module file associated with this manifest. -RootModule = 'PureStoragePowerShellToolkit.Reporting.psm1' - -# Version number of this module. - -ModuleVersion = '3.0.0.3' - -# Supported PSEditions -#CompatiblePSEditions = @("Desktop", "Core") - -# ID used to uniquely identify this module -GUID = '742a7736-fc7f-4f84-84b2-af58ac435f2b' - -# Author of this module -Author = 'Pure Storage' - -# Company or vendor of this module -CompanyName = 'Pure Storage, Inc.' - -# Copyright statement for this module -Copyright = '(c) 2023 Pure Storage, Inc. All rights reserved.' - -# Description of the functionality provided by this module -Description = 'PowerShell Toolkit for Pure Storage Flasharray and Initiators.' - -# Minimum version of the Windows PowerShell engine required by this module -PowerShellVersion = '5.1' - -# Name of the Windows PowerShell host required by this module -PowerShellHostName = '' - -# Minimum version of the Windows PowerShell host required by this module -PowerShellHostVersion = '' - -# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -DotNetFrameworkVersion = '4.5' - -# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -CLRVersion = '' - -# Processor architecture (None, X86, Amd64) required by this module -ProcessorArchitecture = '' - -# Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( - @{ - ModuleName = 'PureStoragePowerShellToolkit.FlashArray' - ModuleVersion = '3.0.0.3' - }, - @{ - ModuleName = 'ImportExcel' - ModuleVersion = '7.8.4' - } -) - -# Assemblies that must be loaded prior to importing this module -RequiredAssemblies = @() - -# Script files (.ps1) that are run in the caller's environment prior to importing this module. -ScriptsToProcess = @() - -# Type files (.ps1xml) to be loaded when importing this module -TypesToProcess = @() - -# Format files (.ps1xml) to be loaded when importing this module -FormatsToProcess = @() - -# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -#NestedModules = @('Show-ModuleLoadBanner.ps1') - -# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -FunctionsToExport = @( - 'New-Pfa2ExcelReport', - 'New-Pfa2HypervClusterVolumeReport' -) - -# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. -CmdletsToExport = @() - -# Variables to export from this module -VariablesToExport = @() - -# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. -AliasesToExport = @() - -# DSC resources to export from this module -DscResourcesToExport = @() - -# List of all modules packaged with this module -ModuleList = @() - -# List of all files packaged with this module -FileList = @() - -# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. -PrivateData = @{ - - PSData = @{ - - # Tags applied to this module. These help with module discovery in online galleries. - Tags = @('PureStorage', 'PowerShell', 'FlashArray') - - # A URL to the license for this module. - LicenseUri = "https://github.com/PureStorage-OpenConnect/PowerShell-Toolkit/blob/dev/LICENSE" - - # A URL to the main website for this project. - ProjectUri = "https://github.com/PureStorage-OpenConnect/PowerShell-Toolkit" - - # A URL to an icon representing this module. - IconUri = "https://github.com/PureStorage-OpenConnect/PowerShell-Toolkit/blob/dev/Installer/icon.ico" - - # ReleaseNotes of this module - ReleaseNotes = "https://github.com/PureStorage-OpenConnect/powershell-toolkit/dev/main/CHANGELOG.md" - - # External dependent modules of this module - # ExternalModuleDependencies = '' - - # If true, the LicenseUrl points to an end-user license (not just a source license) which requires the user agreement before use. - # RequireLicenseAcceptance = "" - - # Indicates this is a pre-release/testing version of the module. - #Prerelease = 'True' - - } # End of PSData hashtable - - } # End of PrivateData hashtable - -# HelpInfo URI of this module -HelpInfoURI = 'https://github.com/PureStorage-OpenConnect/powershell-toolkit' - -# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. -DefaultCommandPrefix = '' - -} - diff --git a/PureStoragePowerShellToolkit.Reporting/PureStoragePowerShellToolkit.Reporting.psm1 b/PureStoragePowerShellToolkit.Reporting/PureStoragePowerShellToolkit.Reporting.psm1 deleted file mode 100644 index fa1a59a..0000000 --- a/PureStoragePowerShellToolkit.Reporting/PureStoragePowerShellToolkit.Reporting.psm1 +++ /dev/null @@ -1,540 +0,0 @@ -<# - =========================================================================== - Release version: 3.0.0 - Revision information: Refer to the changelog.md file - --------------------------------------------------------------------------- - Maintained by: FlashArray Integrations and Evangelsigm Team @ Pure Storage - Organization: Pure Storage, Inc. - Filename: PureStoragePowerShellToolkit.Reporting.psm1 - Copyright: (c) 2023 Pure Storage, Inc. - Module Name: PureStoragePowerShellToolkit.Reporting - Description: PowerShell Script Module (.psm1) - -------------------------------------------------------------------------- - Disclaimer: - The sample module and documentation are provided AS IS and are not supported by the author or the author’s employer, unless otherwise agreed in writing. You bear - all risk relating to the use or performance of the sample script and documentation. The author and the author’s employer disclaim all express or implied warranties - (including, without limitation, any warranties of merchantability, title, infringement or fitness for a particular purpose). In no event shall the author, the author’s employer or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever arising out of the use or performance of the sample script and documentation (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss), even if such person has been advised of the possibility of such damages. - -------------------------------------------------------------------------- - Contributors: Rob "Barkz" Barker @purestorage, Robert "Q" Quimbey @purestorage, Mike "Chief" Nelson, Julian "Doctor" Cates, Marcel Dussil @purestorage - https://en.pureflash.blog/ , Craig Dayton - https://github.com/cadayton , Jake Daniels - https://github.com/JakeDennis, Richard Raymond - https://github.com/data-sciences-corporation/PureStorage , The dbatools Team - https://dbatools.io , many more Puritans, and all of the Pure Code community who provide excellent advice, feedback, & scripts now and in the future. - =========================================================================== -#> - -#Requires -Version 5 -#Requires -Modules @{ ModuleName='ImportExcel'; ModuleVersion='7.8.4' } -#Requires -Modules @{ ModuleName='PureStoragePowerShellToolkit.FlashArray'; ModuleVersion='3.0.0.3' } - -#region Helper functions - -function Convert-UnitOfSize { - [CmdletBinding()] - param ( - [parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] - $Value, - $To = 1GB, - $From = 1, - $Decimals = 2 - ) - - process { - return [math]::Round($Value * $From / $To, $Decimals) - } -} - -function Write-Color { - [CmdletBinding()] - param( - [Parameter(Position = 0, Mandatory, ValueFromPipeline)] - [string[]] - $Text, - - [ConsoleColor[]] - $ForegroundColor = ([console]::ForegroundColor), - - [ConsoleColor[]] - $BackgroundColor = ([console]::BackgroundColor), - - [int] - $Indent = 0, - - [int] - $LeadingSpace = 0, - - [int] - $TrailingSpace = 0, - - [switch] - $NoNewLine - ) - - begin { - $baseParams = @{ - ForegroundColor = [console]::ForegroundColor - BackgroundColor = [console]::BackgroundColor - NoNewline = $true - } - - # Add leading lines - Write-Host ("`n" * $LeadingSpace) @baseParams - } - - process { - # Add TABs before text - Write-Host ("`t" * $Indent) @baseParams - - if ($PSBoundParameters.ContainsKey('ForegroundColor') -or $PSBoundParameters.ContainsKey('BackgroundColor')) { - $writeParams = $baseParams.Clone() - for ($i = 0; $i -lt $Text.Count; $i++) { - - if ($i -lt $ForegroundColor.Count) { - $writeParams['ForegroundColor'] = $ForegroundColor[$i] - } - - if ($i -lt $BackgroundColor.Count) { - $writeParams['BackgroundColor'] = $BackgroundColor[$i] - } - - Write-Host $Text[$i] @writeParams - } - } else { - Write-Host $Text -NoNewline - } - - if (-not $NoNewLine) { - Write-Host - } - } - - end { - if (-not $NoNewLine) { - Write-Host ("`n" * $TrailingSpace) @baseParams - } - } -} - -#endregion Helper functions - -function New-Pfa2ExcelReport { - <# - .SYNOPSIS - Create an Excel workbook that contains FlashArray Information for each endpoint specified. - .DESCRIPTION - This cmdlet will retrieve array, volume, host, pod, and snapshot capacity information from all of the endpoints and output it to an Excel spreadsheet. Each FlashArray will have it's own filename and the current date and time will be added to the filenames. - This cmdlet requires the PowerShell module ImportExcel - https://www.powershellgallery.com/packages/ImportExcel - .PARAMETER Endpoint - Required. An IP address or FQDN of the FlashArray. Multiple endpoints can be specified. - .PARAMETER OutPath - Optional. Directory path for Excel workbook. If not specified, the files will be placed in the %temp% folder. - .PARAMETER SnapLimit - Optional. This will limit the total number of Volume snapshots returned from the arrays. This will be beneficial when working with a large number of snapshots. With a large number of snapshots, and not setting this limit, the worksheet creation time is increased considerably. - .PARAMETER Credential - Optional. Credential for the FlashArray. - .INPUTS - None - .OUTPUTS - An Excel workbook - .EXAMPLE - New-Pfa2ExcelReport -Endpoint 'myarray.mydomain.com' - - Creates an Excel file in the %temp% folder for array myarray.mydomain.com. - - .EXAMPLE - New-Pfa2ExcelReport -Endpoint 'myarray01', 'myarray02' -OutPath '.\reports' - - Creates an Excel file for myarray01 and myarray02. Reports are located in the 'reports' folder. - - .EXAMPLE - Get-Content '.\arrays.txt' | New-Pfa2ExcelReport -OutPath '.\reports' - - Creates an Excel file for each array in the arrays.txt file. Reports are located in the 'reports' folder. - - .EXAMPLE - New-Pfa2ExcelReport -Endpoint 'myarray.mydomain.com' -Credential (Get-Credential) -OutPath '.\reports' - - Creates an Excel file in the 'reports' folder for array myarray.mydomain.com. Asks for FlashArray credentials. - - .EXAMPLE - $endpoint = [pscustomobject]@{Endpoint = @('myarray.mydomain.com'); Credential = (Get-Credential)} - $endpoint | New-Pfa2ExcelReport -OutPath '.\reports' - - Creates an Excel file in the 'reports' folder for array myarray.mydomain.com. Asks for FlashArray credentials. - - .NOTES - This cmdlet can utilize the global credential variable for FlashArray authentication. Set the credential variable by using the command Set-Pfa2Credential. - #> - - [CmdletBinding()] - Param ( - [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] - [ValidateNotNullOrEmpty()] - [string[]]$Endpoint, - [int]$SnapLimit, - [string]$OutPath = $env:Temp, - [Parameter(ValueFromPipelineByPropertyName)] - [pscredential]$Credential = ( Get-Pfa2Credential ) - ) - - begin { - $date = (Get-Date).ToString('MMddyyyy_HHmmss') - } - - process { - # Run through each array - foreach ($e in $Endpoint) { - Write-Host "Starting to read from array $e ..." -ForegroundColor green - - # Connect to FlashArray(s) - try { - $flashArray = Connect-Pfa2Array -Endpoint $e -Credential $Credential -IgnoreCertificateError - } - catch { - $exceptionMessage = $_.Exception.Message - Write-Error "Failed to connect to FlashArray endpoint $e with: $exceptionMessage" - Return - } - - try { - $array_details = Get-Pfa2Array -Array $flasharray - $host_details = Get-Pfa2Host -Array $flasharray -Sort 'name' - $hostgroup = Get-Pfa2HostGroup -Array $flasharray - $volumes = Get-Pfa2Volume -Array $flasharray -Sort 'name' - $pgd = Get-Pfa2ProtectionGroup -Array $flasharray - $pgst = Get-Pfa2ProtectionGroupSnapshotTransfer -Array $flasharray -Sort 'name' - $controllers = Get-Pfa2Controller -Array $flasharray - $controller0_details = $controllers | Where-Object Name -eq 'CT0' - $controller1_details = $controllers | Where-Object Name -eq 'CT1' - $free = $array_details.capacity - $array_details.space.TotalPhysical - $lim = @{} - if ($PSBoundParameters.ContainsKey('SnapLimit')) { - $lim.Add('Limit', $SnapLimit) - } - $snapshots = Get-Pfa2VolumeSnapshot -Array $flashArray @lim - $pods = Get-Pfa2Pod -Array $flashArray - - Write-Host 'Read complete. Disconnecting and continuing...' -ForegroundColor green - } - finally { - # Disconnect 'cause we don't need to waste the connection anymore - Disconnect-Pfa2Array -Array $flasharray - } - - # Name and path the files - $excelFile = Join-Path $OutPath "$($array_details.name)-$date.xlsx" - Write-Host 'Writing data to Excel workbook...' -ForegroundColor green - - # Array Information - [PSCustomObject]@{ - 'Array Name' = ($array_details.Name).ToUpper() - 'Array ID' = $array_details.Id - 'Purity Version' = $array_details.Version - 'CT0-Mode' = $controller0_details.Mode - 'CT0-Status' = $controller0_details.Status - 'CT1-Mode' = $controller1_details.Mode - 'CT1-Status' = $controller1_details.Status - '% Utilized' = '{0:P}' -f ($array_details.space.TotalPhysical / $array_details.capacity) - 'Total Capacity(TB)' = Convert-UnitOfSize $array_details.Capacity -To 1TB - 'Used Capacity(TB)' = Convert-UnitOfSize $array_details.space.TotalPhysical -To 1TB - 'Free Capacity(TB)' = Convert-UnitOfSize $free -To 1TB - 'Provisioned Size(TB)' = Convert-UnitOfSize $array_details.space.TotalProvisioned -To 1TB - 'Unique Data(TB)' = Convert-UnitOfSize $array_details.space.Unique -To 1TB - 'Shared Data(TB)' = Convert-UnitOfSize $array_details.space.shared -To 1TB - 'Snapshot Capacity(TB)' = Convert-UnitOfSize $array_details.space.snapshots -To 1TB - } | Export-Excel $excelFile -WorksheetName 'Array_Info' -AutoSize -TableName 'ArrayInformation' -Title 'FlashArray Information' - - ## Volume Details - $details = $volumes | Select-Object Name, ` - @{n = 'Size(GB)'; e = { Convert-UnitOfSize $_.provisioned -To 1GB } }, ` - @{n = 'Unique Data(GB)'; e = { Convert-UnitOfSize $_.space.Unique -To 1GB } }, ` - @{n = 'Shared Data(GB)'; e = { Convert-UnitOfSize $_.space.Shared -To 1GB } }, ` - Serial, ` - ConnectionCount, ` - Created, ` - @{n = 'Volume Group'; e = { $_.VolumeGroup.Name } }, ` - Destroyed, ` - @{n = 'Time Remaining'; e = { - if ($_.TimeRemaining) { - $span = [TimeSpan]::FromMilliseconds($_.TimeRemaining) - "{0:D2}h {1:D2}m" -f ($span.Days * 24 + $span.Hours), $span.Minutes - } - } } - - $simple = @() - $vvol = @() - foreach ($v in $details) { - if ($v.Name -like '*vvol*') { - $vvol +=$v - } - else { - $simple +=$v - } - } - - if ($simple) { - $simple | Export-Excel $excelFile -WorksheetName 'Volumes-No vVols' -AutoSize -TableName 'VolumesNovVols' -Title 'Volumes - Not including vVols' - } - else { - Write-Host 'No Volumes exist on Array. Skipping.' - } - - if ($vvol) { - $vvol | Export-Excel $excelFile -WorksheetName 'vVol Volumes' -AutoSize -TableName 'vVolVolumes' -Title 'vVol Volumes' - } - else { - Write-Host 'No vVol Volume exist on Array. Skipping.' - } - - ## Volume Snapshot details - if ($snapshots) { - $snapshots | Select-Object Name, ` - Created, ` - @{n = 'Provisioned(GB)'; e = { Convert-UnitOfSize $_.Provisioned -To 1GB } }, ` - Destroyed, ` - @{n = 'Source'; e = { $_.Source.Name } }, ` - @{n = 'Pod'; e = { $_.pod.name } }, ` - @{n = 'Volume Group'; e = { $_.VolumeGroup.Name } } | - Export-Excel $excelFile -WorksheetName 'Volume Snapshots' -AutoSize -TableName 'VolumeSnapshots' -Title 'Volume Snapshots' - } - else { - Write-Host 'No Volume Snapshots exist on Array. Skipping.' - } - - # Host Details - if ($host_details) { - $host_details | Select-Object Name, ` - @{n = 'No. of Volumes'; e = { $_.ConnectionCount } }, ` - @{n = 'HostGroup'; e = { $_.HostGroup.Name } }, ` - Personality, ` - @{n = 'Allocated(GB)'; e = { Convert-UnitOfSize $_.space.totalprovisioned -To 1GB } }, ` - @{n = 'Wwns'; e = { $_.Wwns -join ', ' } } | - Export-Excel $excelFile -WorksheetName 'Hosts' -AutoSize -TableName 'Hosts' -Title 'Host Information' - } - else { - Write-Host 'No Hosts exist on Array. Skipping.' - } - - ## HostGroup Details - if ($hostgroup) { - $hostgroup | Select-Object Name, ` - HostCount, ` - @{n = 'No. of Volumes'; e = { $_.ConnectionCount } }, ` - @{n = 'Total Size(GB)'; e = { Convert-UnitOfSize $_.space.totalprovisioned -To 1GB } } | - Export-Excel $excelFile -WorksheetName 'Host Groups' -AutoSize -TableName 'HostGroups' -Title 'Host Groups' - } - else { - Write-Host 'No Host Groups exist on Array. Skipping.' - } - - ## Protection Group and Protection Group Transfer details - if ($pgd) { - $pgd | Select-Object Name, ` - @{n = 'Snapshot Size(GB)'; e = { Convert-UnitOfSize $_.space.snapshots -To 1GB } }, ` - VolumeCount, ` - @{n = 'Source'; e = { $_.source.name } } | - Export-Excel $excelFile -WorksheetName 'Protection Groups' -AutoSize -TableName 'ProtectionGroups' -Title 'Protection Group' - } - else { - Write-Host 'No Protection Groups exist on Array. Skipping.' - } - - if ($pgst) { - $pgst | Select-Object Name, ` - @{n = 'Data Transferred(MB)'; e = { Convert-UnitOfSize $_.DataTransferred -To 1MB } }, ` - Destroyed, ` - @{n = 'Physical Bytes Written(MB)'; e = { Convert-UnitOfSize $_.PhysicalBytesWritten -To 1MB } }, ` - @{n = 'Status'; e = { $_.Progress -Replace ('1', 'Transfer Complete') } } | - Export-Excel $excelFile -WorksheetName 'PG Snapshot Transfers' -AutoSize -TableName 'PGroupSnapshotTransfers' -Title 'Protection Group Snapshot Transfers' - } - else { - Write-Host 'No Protection Group Transfer details on Array. Skipping.' - } - - ## Pod details - if ($pods) { - $pods | Select-Object Name, ` - ArrayCount, ` - @{ n = 'Source'; e = { $_.source.name } }, ` - Mediator, ` - PromotionStatus, ` - Destroyed | - Export-Excel $excelFile -WorksheetName 'Pods' -AutoSize -TableName 'Pods' -Title 'Pod Information' - } - else { - Write-Host 'No Pods exist on Array. Skipping.' - } - } - } - - end{ - Write-Host "Complete. Files located in $(Resolve-Path $OutPath)" -ForegroundColor green - } -} - -function New-Pfa2HypervClusterVolumeReport() { - <# - .SYNOPSIS - Creates a Excel report on volumes connected to a Hyper-V cluster. - .DESCRIPTION - This creates separate CSV files for VM, Windows Hosts, and FlashArray information for each endpoint specified that is part of a HyperV cluster. It then takes that output and places it into a an Excel workbook that contains sheets for each CSV file. - .PARAMETER Endpoint - Required. An IP address or FQDN of the FlashArray. Multiple endpoints can be specified. - .PARAMETER VmCsvFileName - Optional. Defaults to VMs.csv. - .PARAMETER WinCsvFileName - Optional. defaults to WindowsHosts.csv. - .PARAMETER PfaCsvFileName - Optional. defaults to FlashArrays.csv. - .PARAMETER ExcelFile - Optional. defaults to HypervClusterReport.xlsx. - .INPUTS - Endpoint is mandatory. VM, Win, and PFA csv file names are optional. - .OUTPUTS - Outputs individual CSV files and creates an Excel workbook that is built using the required PowerShell module ImportExcel, created by Douglas Finke. - .EXAMPLE - New-Pfa2HypervClusterVolumeReport -Endpoint myarray -VmCsvName myVMs.csv -WinCsvName myWinHosts.csv -PfaCsvName myFlashArray.csv -ExcelFile myExcelFile.xlsx - - This will create three separate CSV files with HyperV cluster information and incorporate them into a single Excel workbook. - - .EXAMPLE - New-Pfa2HypervClusterVolumeReport -Endpoint 'myarray01', 'myarray02' - - This will create files with HyperV cluster information, and FlashArray information for myarray01, and myarray02. - - .EXAMPLE - Get-Content '.\arrays.txt' | New-Pfa2HypervClusterVolumeReport - - This will create files with HyperV cluster information, and FlashArray information for each array in the arrays.txt file. - - .EXAMPLE - New-Pfa2HypervClusterVolumeReport -Endpoint 'myarray.mydomain.com' -Credential (Get-Credential) - - This will create files with HyperV cluster information, and FlashArray information for myarray.mydomain.com. Asks for FlashArray credentials. - - .EXAMPLE - $endpoint = [pscustomobject]@{Endpoint = @('myarray.mydomain.com'); Credential = (Get-Credential)} - $endpoint | New-Pfa2HypervClusterVolumeReport - - This will create files with HyperV cluster information, and FlashArray information for myarray.mydomain.com. Asks for FlashArray credentials. - - .NOTES - This cmdlet can utilize the global credential variable for FlashArray authentication. Set the credential variable by using the command Set-Pfa2Credential. - #> - - [CmdletBinding()] - Param ( - [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] - [ValidateNotNullOrEmpty()] - [string[]]$Endpoint, - [string]$VmCsvFileName = "VMs.csv", - [string]$WinCsvFileName = "WindowsHosts.csv", - [string]$PfaCsvFileName = "FlashArrays.csv", - [string]$ExcelFile = "HypervClusterReport.xlsx", - [Parameter(ValueFromPipelineByPropertyName)] - [pscredential]$Credential = ( Get-Pfa2Credential ) - ) - - begin { - #Validate modules - $modules = @('Hyper-V', 'FailoverClusters') - foreach ($module in $modules) { - if (-not (Get-Module -ListAvailable $module)) { - Write-Error "Required module $module not found" - return - } - } - - #Get VMs & VHDs - $nodes = Get-ClusterNode - $vhds = Get-VM -ComputerName $nodes.Name | ForEach-Object { $_ } -PipelineVariable 'vm' | ForEach-Object { - Get-Vhd -ComputerName $_.ComputerName -VmId $_.VmId - } | ForEach-Object { - [pscustomobject]@{ - 'VM Name' = $vm.Name - 'VM State' = $vm.State - ComputerName = $_.ComputerName - Path = $_.Path - 'VHD Type' = $_.VhdType - 'Size (GB)' = Convert-UnitOfSize $_.Size -To 1GB - 'Size on disk (GB)' = Convert-UnitOfSize $_.FileSize -To 1GB - } - } - - if ($vhds) { - $vhds | Export-Csv $VmCsvFileName -NoTypeInformation - $vhds | Export-Excel -Path $ExcelFile -AutoSize -WorkSheetname 'VMs' -TableName 'vm' - } - - #Get hosts and volumes - $volumes = $nodes | ForEach-Object { $_ } -PipelineVariable 'node' | ForEach-Object { - Get-Disk -CimSession $node.Name | Where-Object Number -ne $null | Get-Partition | Get-Volume - } | Where-Object DriveType -eq Fixed | ForEach-Object { - [pscustomobject]@{ - ComputerName = $node.Name - Label = $_.FileSystemLabel - Name = if ($_.DriveLetter) { "$($_.DriveLetter):\" } else { $_.Path } - 'Total size (GB)' = Convert-UnitOfSize $_.Size -To 1GB - 'Free space (GB)' = Convert-UnitOfSize $_.SizeRemaining -To 1GB - 'Size on disk (GB)' = Convert-UnitOfSize ($_.Size - $_.SizeRemaining) -To 1GB - } - } - - if ($volumes) { - $volumes | Export-Csv $WinCsvFileName -NoTypeInformation - $volumes | Export-Excel -Path $ExcelFile -AutoSize -WorkSheetname 'Windows Hosts' -TableName 'host' - } - - #Get Pure volumes - $sn = $vhds | - ForEach-Object { Get-Volume -FilePath $_.Path -CimSession $_.ComputerName } | - Group-Object 'ObjectId' | - ForEach-Object { $_.Group[0] } | - Get-Partition | - Get-Disk | - Select-Object -ExpandProperty 'SerialNumber' - - $pureVolumes = @() - } - - process { - #Run through each array - foreach ($e in $Endpoint) { - #Connect to FlashArray - try { - $flashArray = Connect-Pfa2Array -Endpoint $e -Credential $Credential -IgnoreCertificateError - } - catch { - $ExceptionMessage = $_.Exception.Message - Write-Error "Failed to connect to FlashArray endpoint $e with: $ExceptionMessage" - return - } - - #FlashArray volumes - try { - $details = Get-Pfa2Array -Array $flasharray - - $pureVolumes += Get-Pfa2Volume -Array $flashArray | Where-Object { $sn -contains $_.serial } | Select-Object 'Name' -ExpandProperty 'Space' | ForEach-Object { - [pscustomobject]@{ - Array = $details.Name - Name = $_.Name - 'Size (GB)' = Convert-UnitOfSize $_.TotalProvisioned -To 1GB - 'Size on disk (GB)' = Convert-UnitOfSize $_.TotalPhysical -To 1GB - 'Data Reduction' = [math]::round($_.DataReduction, 2) - } - } - } - finally { - Disconnect-Pfa2Array -Array $flashArray - } - } - } - - end { - if ($pureVolumes) { - $pureVolumes | Export-Csv $PfaCsvFileName -NoTypeInformation - $pureVolumes | Export-Excel -Path $ExcelFile -AutoSize -WorkSheetname 'FlashArrays' -TableName 'volume' - } - } -} - -# Declare exports -Export-ModuleMember -Function New-Pfa2ExcelReport -Export-ModuleMember -Function New-Pfa2HypervClusterVolumeReport -# END diff --git a/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psd1 b/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psd1 index 63fb198..c3f9a8d 100644 --- a/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psd1 +++ b/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psd1 @@ -29,7 +29,7 @@ RootModule = 'PureStoragePowerShellToolkit.WindowsAdministration.psm1' # Version number of this module. -ModuleVersion = '3.0.0.3' +ModuleVersion = '3.0.1' # Supported PSEditions #CompatiblePSEditions = @("Desktop", "Core") @@ -71,7 +71,7 @@ ProcessorArchitecture = '' RequiredModules = @( @{ ModuleName = 'PureStoragePowerShellToolkit.FlashArray' - ModuleVersion = '3.0.0.3' + ModuleVersion = '3.0.1' } ) diff --git a/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psm1 b/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psm1 index ab6efab..0a8d0a5 100644 --- a/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psm1 +++ b/PureStoragePowerShellToolkit.WindowsAdministration/PureStoragePowerShellToolkit.WindowsAdministration.psm1 @@ -1,6 +1,6 @@ <# =========================================================================== - Release version: 3.0.0 + Release version: 3.0.1 Revision information: Refer to the changelog.md file --------------------------------------------------------------------------- Maintained by: FlashArray Integrations and Evangelsigm Team @ Pure Storage @@ -20,25 +20,25 @@ #> #Requires -Version 5 -#Requires -Modules @{ ModuleName='PureStoragePowerShellToolkit.FlashArray'; ModuleVersion='3.0.0.3' } - -#region Helper functions - -function Convert-UnitOfSize { - [CmdletBinding()] - param ( - [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] - [AllowNull()] - $Value, - $To = 1GB, - $From = 1, - $Decimals = 2 - ) - - process { - return [math]::Round($Value * $From / $To, $Decimals) - } -} +#Requires -Modules @{ ModuleName='PureStoragePowerShellToolkit.FlashArray'; ModuleVersion='3.0.1' } + +#region Helper functions + +function Convert-UnitOfSize { + [CmdletBinding()] + param ( + [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] + [AllowNull()] + $Value, + $To = 1GB, + $From = 1, + $Decimals = 2 + ) + + process { + return [math]::Round($Value * $From / $To, $Decimals) + } +} function Write-Color { [CmdletBinding()] @@ -111,89 +111,89 @@ function Write-Color { } } -#endregion Helper functions - -function Get-Pfa2SerialNumbers() { - <# - .SYNOPSIS - Retrieves FlashArray disk serial numbers connected to the host. - .DESCRIPTION - Cmdlet retrieves disk serial numbers that are associated to Pure FlashArrays. - .PARAMETER CimSession - Optional. A CimSession or computer name. CIM session may be reused. - .INPUTS - CimSession is optional. - .OUTPUTS - Outputs serial numbers of FlashArrays devices. - .EXAMPLE - Get-Pfa2SerialNumbers - - Returns serial number information on Pure FlashArray disk devices connected to the host. - - .EXAMPLE - Get-Pfa2SerialNumbers -CimSession 'myComputer' - - Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' with current credentials. - - .EXAMPLE - $session = New-CimSession 'myComputer' -Credential (Get-Credential) - Get-Pfa2SerialNumbers -CimSession $session - Get-Pfa2HostBusAdapter -CimSession $session - - Returns serial number information on Pure FlashArray disk devices and host bus adapter - with previously created CIM session. - - .EXAMPLE - Get-Pfa2SerialNumbers -CimSession (New-CimSession 'myComputer' -Credential $Creds) - - Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' - with credentials stored in variable $Creds. - - .EXAMPLE - Get-Pfa2SerialNumbers -CimSession (New-CimSession 'myComputer' -Credential (Get-Secret admin)) - - Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' - with credentials stored in a secret vault. - - .EXAMPLE - Get-Pfa2SerialNumbers -CimSession (New-CimSession 'myComputer' -Credential (Get-Credential)) - - Returns serial number information on Pure FlashArray disk devices connected to 'myComputer'. Asks for credentials. - - .EXAMPLE - 'myComputer' | Get-Pfa2SerialNumbers - - Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' with current credentials. - - .EXAMPLE - $session = New-CimSession 'myComputer' -Credential (Get-Credential) - $session | Get-Pfa2SerialNumbers - - Returns serial number information on Pure FlashArray disk devices with previously created CIM session. - - .EXAMPLE - 'myComputer01', 'myComputer02' | Get-Pfa2SerialNumbers - - Returns serial number information on Pure FlashArray disk devices connected to 'myComputer01' and 'myComputer02' with current credentials. - - .EXAMPLE - $prod = [pscustomobject]@{Caption = 'Prod Server'; CimSession = 'myComputer'} - $prod | Get-Pfa2SerialNumbers - - Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' with current credentials. - #> - - [CmdletBinding()] - Param ( - [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] - [ValidateNotNull()] - [CimSession]$CimSession - ) - - process { - Get-Disk -FriendlyName 'PURE FlashArray*' @PSBoundParameters | Select-Object PSComputerName, Number, SerialNumber - } -} +#endregion Helper functions + +function Get-Pfa2SerialNumbers() { + <# + .SYNOPSIS + Retrieves FlashArray disk serial numbers connected to the host. + .DESCRIPTION + Cmdlet retrieves disk serial numbers that are associated to Pure FlashArrays. + .PARAMETER CimSession + Optional. A CimSession or computer name. CIM session may be reused. + .INPUTS + CimSession is optional. + .OUTPUTS + Outputs serial numbers of FlashArrays devices. + .EXAMPLE + Get-Pfa2SerialNumbers + + Returns serial number information on Pure FlashArray disk devices connected to the host. + + .EXAMPLE + Get-Pfa2SerialNumbers -CimSession 'myComputer' + + Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' with current credentials. + + .EXAMPLE + $session = New-CimSession 'myComputer' -Credential (Get-Credential) + Get-Pfa2SerialNumbers -CimSession $session + Get-Pfa2HostBusAdapter -CimSession $session + + Returns serial number information on Pure FlashArray disk devices and host bus adapter + with previously created CIM session. + + .EXAMPLE + Get-Pfa2SerialNumbers -CimSession (New-CimSession 'myComputer' -Credential $Creds) + + Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' + with credentials stored in variable $Creds. + + .EXAMPLE + Get-Pfa2SerialNumbers -CimSession (New-CimSession 'myComputer' -Credential (Get-Secret admin)) + + Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' + with credentials stored in a secret vault. + + .EXAMPLE + Get-Pfa2SerialNumbers -CimSession (New-CimSession 'myComputer' -Credential (Get-Credential)) + + Returns serial number information on Pure FlashArray disk devices connected to 'myComputer'. Asks for credentials. + + .EXAMPLE + 'myComputer' | Get-Pfa2SerialNumbers + + Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' with current credentials. + + .EXAMPLE + $session = New-CimSession 'myComputer' -Credential (Get-Credential) + $session | Get-Pfa2SerialNumbers + + Returns serial number information on Pure FlashArray disk devices with previously created CIM session. + + .EXAMPLE + 'myComputer01', 'myComputer02' | Get-Pfa2SerialNumbers + + Returns serial number information on Pure FlashArray disk devices connected to 'myComputer01' and 'myComputer02' with current credentials. + + .EXAMPLE + $prod = [pscustomobject]@{Caption = 'Prod Server'; CimSession = 'myComputer'} + $prod | Get-Pfa2SerialNumbers + + Returns serial number information on Pure FlashArray disk devices connected to 'myComputer' with current credentials. + #> + + [CmdletBinding()] + Param ( + [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] + [ValidateNotNull()] + [CimSession]$CimSession + ) + + process { + Get-Disk -FriendlyName 'PURE FlashArray*' @PSBoundParameters | Select-Object PSComputerName, Number, SerialNumber + } +} function Get-Pfa2HostBusAdapter() { <# diff --git a/PureStoragePowerShellToolkit/PureStoragePowerShellToolkit.psd1 b/PureStoragePowerShellToolkit/PureStoragePowerShellToolkit.psd1 index 9aa279e..cdca323 100644 --- a/PureStoragePowerShellToolkit/PureStoragePowerShellToolkit.psd1 +++ b/PureStoragePowerShellToolkit/PureStoragePowerShellToolkit.psd1 @@ -29,7 +29,7 @@ # Version number of this module. -ModuleVersion = '3.0.0.3' +ModuleVersion = '3.0.1' # Supported PSEditions #CompatiblePSEditions = @("Desktop", "Core") @@ -71,19 +71,15 @@ ProcessorArchitecture = '' RequiredModules = @( @{ ModuleName = 'PureStoragePowerShellToolkit.Core' - ModuleVersion = '3.0.0.3' - }, - @{ - ModuleName = 'PureStoragePowerShellToolkit.Reporting' - ModuleVersion = '3.0.0.3' + ModuleVersion = '3.0.1' }, @{ ModuleName = 'PureStoragePowerShellToolkit.WindowsAdministration' - ModuleVersion = '3.0.0.3' + ModuleVersion = '3.0.1' }, @{ ModuleName = 'PureStoragePowerShellToolkit.Exchange' - ModuleVersion = '3.0.0.3' + ModuleVersion = '3.0.1' } )