Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit dbe68f7

Browse files
committed
2.0.3.3
1 parent b7c8549 commit dbe68f7

File tree

3 files changed

+144
-67
lines changed

3 files changed

+144
-67
lines changed

CHANGELOG.md

Lines changed: 80 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,61 @@
11
Pure Storage PowerShell Toolkit
22

3-
# Revision 2.0.3.x
3+
# Revision 2.0.3.3
4+
5+
03-08-2022
6+
7+
- Added cmdlet Restore-PfaPGroupVolumeSnapshots
8+
9+
# Revision 2.0.3.2
10+
11+
10-20-2021
12+
13+
- Corrected folder create in Get-WindowsDiagnosticInfo function
14+
15+
# Revision 2.0.3.1
16+
417
9-27-2021
5-
* typo in psd1 file fixed
6-
* Fixed Get-MPIODiskLBPolicy and Set-MPIODiskLBPolicy cmdlets to use correct execution and parameters with mpclaim.exe.
7-
* Added helper function to check for SDK v2 module.
8-
* NOTE: Purity API versions 2.0 and 2.1 require authentication via OAuth. The logic is not yet included to authenticate
9-
using this method, so only Token authentication can happen at this time with any cmdlets that require the SDKv2.
10-
The logic to allow OAuth will be added to a future revision.
11-
* Added Get-FlashArrayConnectDetails cmdlet. Thanks to JD Wallace.
12-
* Formatting changes
18+
19+
- typo in psd1 file fixed
20+
- Fixed Get-MPIODiskLBPolicy and Set-MPIODiskLBPolicy cmdlets to use correct execution and parameters with mpclaim.exe.
21+
- Added helper function to check for SDK v2 module.
22+
- NOTE: Purity API versions 2.0 and 2.1 require authentication via OAuth. The logic is not yet included to authenticate
23+
using this method, so only Token authentication can happen at this time with any cmdlets that require the SDKv2.
24+
The logic to allow OAuth will be added to a future revision.
25+
- Added Get-FlashArrayConnectDetails cmdlet. Thanks to JD Wallace.
26+
- Formatting changes
27+
1328
# Revision 2.0.2.0
29+
1430
8-23-2021
15-
* Added cmdlets:
16-
Get-WindowsDiagnosticInfo, Get-FlashArrayRASession, Get-FlashArrayQuickCapacityStats, New-FlashArrayPGroupVolumes, Get-FlashArrayVolumeGrowth
17-
Changed cmdlets: Show-FlashArrayPGroupsConfig to proper verb of Get-FlashArrayPGroupsConfig
18-
Changed cmdlets: 'Pfa' prefixed cmdlets to 'FlashArray' for clarity with SDK v1 cmdlet naming as well as future FlashBlade cmdlets:
19-
Get-PfaSerialNumbers to Get-FlashArraySerialNumbers
20-
New-PfaDbSnapshot to New-FlashArrayDbSnapshot
21-
Invoke-PfaDbRefresh to Invoke-FlashArrayDbRefresh
31+
32+
- Added cmdlets:
33+
Get-WindowsDiagnosticInfo, Get-FlashArrayRASession, Get-FlashArrayQuickCapacityStats, New-FlashArrayPGroupVolumes, Get-FlashArrayVolumeGrowth
34+
Changed cmdlets: Show-FlashArrayPGroupsConfig to proper verb of Get-FlashArrayPGroupsConfig
35+
Changed cmdlets: 'Pfa' prefixed cmdlets to 'FlashArray' for clarity with SDK v1 cmdlet naming as well as future FlashBlade cmdlets:
36+
Get-PfaSerialNumbers to Get-FlashArraySerialNumbers
37+
New-PfaDbSnapshot to New-FlashArrayDbSnapshot
38+
Invoke-PfaDbRefresh to Invoke-FlashArrayDbRefresh
2239

2340
# Revision 2.0.1.0
41+
2442
7-28-2021
25-
* Merged Pure Storage DBAToolkit functions
26-
* Cleaned up typos in Help
43+
44+
- Merged Pure Storage DBAToolkit functions
45+
- Cleaned up typos in Help
2746

2847
# Revision 2.0.0.0
48+
2949
Release version: 2.0.0.0
3050
Release date: 7.13.2021
31-
* Refactoring and cleanup of version 1911.0 coding.
32-
* Additional helper functions added for SDK module check/load, admin-level check, Hyper-V checks, and FlashArray login.
33-
* Adding of the global $Creds variable to make single array authentication easier.
34-
** Create the $Creds variable by issuing a $Creds = Get-Credential command.
35-
* 13 new cmdlets added (see list below).
36-
* 2 cmdlets removed.
37-
* Help fully updated.
51+
52+
- Refactoring and cleanup of version 1911.0 coding.
53+
- Additional helper functions added for SDK module check/load, admin-level check, Hyper-V checks, and FlashArray login.
54+
- Adding of the global $Creds variable to make single array authentication easier.
55+
\*\* Create the $Creds variable by issuing a $Creds = Get-Credential command.
56+
- 13 new cmdlets added (see list below).
57+
- 2 cmdlets removed.
58+
- Help fully updated.
3859

3960
## Known Issues
4061

@@ -44,37 +65,37 @@ Cmdlet Get-FlashArrayDisconnectedVolumes - Code returning error for 'hash.Add' f
4465

4566
## Cmdlets included
4667

47-
* Get-AllHostVolumeInfo
48-
* Set-WindowsPowerScheme
49-
* Get-HostBusAdapter
50-
* Register-HostVolumes
51-
* Unregister-HostVolumes
52-
* Get-QuickFixEngineering
53-
* Test-WindowsBestPractices
54-
* New-VolumeShadowCopy
55-
* Get-VolumeShadowCopy
56-
* New-FlashArrayCapacityReport
57-
* Update-DriveInformation
58-
* Sync-FlashArrayHosts
59-
* Get-FlashArraySerialNumbers
60-
* New-HypervClusterVolumeReport
61-
* Set-TlsVersions
62-
* Get-MPIODiskLBPolicy
63-
* Set-MPIODiskLBPolicy
64-
* Get-FlashArrayStaleSnapshots
65-
* Get-FlashArrayDisconnectedVolumes
66-
* Get-FlashArrayArraySpace
67-
* Get-FlashArrayPgroupsConfig
68-
* Remove-FlashArrayPendingDeletes
69-
* Get-FlashArrayConfig
70-
* Get-FlashArraySerialNumbers
71-
* Get-FlashArrayHierarchy
72-
* New-FlashArrayDbSnapshot
73-
* Invoke-DynamicDataMasking
74-
* Invoke-StaticDataMasking
75-
* Invoke-FlashArrayDbRefresh
76-
* Get-WindowsDiagnosticInfo
77-
* Get-FlashArrayRASession
78-
* Get-FlashArrayQuickCapacityStats
79-
* New-FlashArrayPGroupVolumes
80-
* Get-FlashArrayVolumeGrowth
68+
- Get-AllHostVolumeInfo
69+
- Set-WindowsPowerScheme
70+
- Get-HostBusAdapter
71+
- Register-HostVolumes
72+
- Unregister-HostVolumes
73+
- Get-QuickFixEngineering
74+
- Test-WindowsBestPractices
75+
- New-VolumeShadowCopy
76+
- Get-VolumeShadowCopy
77+
- New-FlashArrayCapacityReport
78+
- Update-DriveInformation
79+
- Sync-FlashArrayHosts
80+
- Get-FlashArraySerialNumbers
81+
- New-HypervClusterVolumeReport
82+
- Set-TlsVersions
83+
- Get-MPIODiskLBPolicy
84+
- Set-MPIODiskLBPolicy
85+
- Get-FlashArrayStaleSnapshots
86+
- Get-FlashArrayDisconnectedVolumes
87+
- Get-FlashArrayArraySpace
88+
- Get-FlashArrayPgroupsConfig
89+
- Remove-FlashArrayPendingDeletes
90+
- Get-FlashArrayConfig
91+
- Get-FlashArraySerialNumbers
92+
- Get-FlashArrayHierarchy
93+
- New-FlashArrayDbSnapshot
94+
- Invoke-DynamicDataMasking
95+
- Invoke-StaticDataMasking
96+
- Invoke-FlashArrayDbRefresh
97+
- Get-WindowsDiagnosticInfo
98+
- Get-FlashArrayRASession
99+
- Get-FlashArrayQuickCapacityStats
100+
- New-FlashArrayPGroupVolumes
101+
- Get-FlashArrayVolumeGrowth

PureStoragePowerShellToolkit.psd1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RootModule = 'PureStoragePowerShellToolkit.psm1'
2929

3030
# Version number of this module.
3131

32-
ModuleVersion = '2.0.3.1'
32+
ModuleVersion = '2.0.3.3'
3333

3434
# Supported PSEditions
3535
#CompatiblePSEditions = @("Desktop", "Core")
@@ -44,13 +44,13 @@ Author = 'Pure Storage'
4444
CompanyName = 'Pure Storage, Inc.'
4545

4646
# Copyright statement for this module
47-
Copyright = '(c) 2021 Pure Storage, Inc. All rights reserved.'
47+
Copyright = '(c) 2022 Pure Storage, Inc. All rights reserved.'
4848

4949
# Description of the functionality provided by this module
5050
Description = 'PowerShell Toolkit for Pure Storage Flasharray and Initiators.'
5151

5252
# Minimum version of the Windows PowerShell engine required by this module
53-
PowerShellVersion = '5.0'
53+
PowerShellVersion = '5.1'
5454

5555
# Name of the Windows PowerShell host required by this module
5656
PowerShellHostName = ''
@@ -121,7 +121,8 @@ FunctionsToExport = @(
121121
'Get-FlashArrayQuickCapacityStats',
122122
'New-FlashArrayPGroupVolumes',
123123
'Get-FlashArrayVolumeGrowth',
124-
'Get-FlashArrayConnectDetails'
124+
'Get-FlashArrayConnectDetails',
125+
'Restore-PfaPGroupVolumeSnapshots'
125126
)
126127

127128
# 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.

PureStoragePowerShellToolkit.psm1

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<#
22
===========================================================================
3-
Release version: 2.0.3.1
3+
Release version: 2.0.3.3
44
Revision information: Refer to the changelog.md file
55
---------------------------------------------------------------------------
6-
Maintained by: fa-solutions@purestorage.com
6+
Maintained by: fa-integrations@purestorage.com
77
Organization: Pure Storage, Inc.
88
Filename: PureStoragePowerShellToolkit.psm1
9-
Copyright: (c) 2021 Pure Storage, Inc.
9+
Copyright: (c) 2022 Pure Storage, Inc.
1010
Module Name: PureStoragePowerShellToolkit
1111
Description: PowerShell Script Module (.psm1)
1212
--------------------------------------------------------------------------
@@ -558,6 +558,60 @@ function Get-FlashArrayRASession() {
558558
}
559559
#endregion
560560

561+
#region Restore-PfaProtectionGroupVolumeSnapshots
562+
function Restore-PfaPGroupVolumeSnapshots() {
563+
<#
564+
.SYNOPSIS
565+
Recover all of the volumes from a protection group (PGroup) snapshot.
566+
.DESCRIPTION
567+
This cmdlet will recover all of the volumes from a protection group (PGroup) snapshot in one operation.
568+
.PARAMETER ProtectionGroup
569+
Required. The name of the Protection Group.
570+
.PARAMETER SnapshotName
571+
Required. The name of the snapshot.
572+
.PARAMETER PGroupPrefix
573+
Required. The name of the Protection Group prefix.
574+
.PARAMETER Hostname
575+
Optional. The hostname to attach the snapshots to.
576+
.INPUTS
577+
None
578+
.OUTPUTS
579+
None
580+
.EXAMPLE
581+
582+
Restore-PfaPGroupVolumeSnapshots –Array $array –ProtectionGroup "VOL1-PGroup" –SnapshotName "VOL1-PGroup.001" –Prefix TEST -Hostname HOST1
583+
584+
Restores protection group snapshots named "VOL1-PGroup.001" from PGroup "VOL1-PGroup", adds the prefix of "TEST" to the name, and attaches them to the host "HOST1" on array $array.
585+
.NOTES
586+
This cmdlet can utilize the global $Creds variable for FlashArray authentication. Set the variable $Creds by using the command $Creds = Get-Credential.
587+
#>
588+
[CmdletBinding()]
589+
Param (
590+
[Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()][string] $Array,
591+
[Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()][string] $ProtectionGroup,
592+
[Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()][string] $SnapshotName,
593+
[Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()][string] $PGroupPrefix,
594+
[Parameter(Mandatory = $False)][ValidateNotNullOrEmpty()][string] $Hostname
595+
596+
)
597+
598+
$PGroupVolumes = Get-PfaProtectionGroup -Array $Array -Name $ProtectionGroup -Session $Session
599+
$PGroupSnapshotsSet = $SnapshotName
600+
601+
ForEach ($PGroupVolume in $PGroupVolumes)
602+
{
603+
For($i=0;$i -lt $PGroupVolume.volumes.Count;$i++)
604+
{
605+
$NewPGSnapshotVol = ($PGroupVolume.volumes[$i]).Replace($PGroupVolume.source+":",$Prefix+"-")
606+
$Source = ($PGroupSnapshotsSet+"."+$PGroupVolumes.volumes[$i]).Replace($PGroupVolume.source+":","")
607+
New-PfaVolume -Array $Array -VolumeName $NewPGSnapshotVol -Source $Source
608+
New-PfaHostVolumeConnection -Array $array -HostName $Hostname -VolumeName $NewPGSnapshotVol
609+
}
610+
}
611+
}
612+
613+
#endregion
614+
561615
#region New-FlashArrayPGroupVolumes
562616
function New-FlashArrayPGroupVolumes() {
563617
<#
@@ -3654,7 +3708,7 @@ function Get-WindowsDiagnosticInfo() {
36543708
Get-ElevatedStatus
36553709
# create root outfile
36563710
$folder = Test-Path -PathType Container -Path "c:\$env:computername"
3657-
if ($folder -eq "False") {
3711+
if ($folder -eq "false") {
36583712
New-Item -Path "c:\$env:computername" -ItemType "directory" | Out-Null
36593713
}
36603714
Set-Location -Path "c:\$env:computername"
@@ -4693,5 +4747,6 @@ Export-ModuleMember -Function Get-FlashArrayQuickCapacityStats
46934747
Export-ModuleMember -Function New-FlashArrayPGroupVolumes
46944748
Export-ModuleMember -Function Get-FlashArrayVolumeGrowth
46954749
Export-ModuleMember -Function Get-FlashArrayConnectDetails
4750+
Export-ModuleMember -Function Restore-PfaPGroupVolumeSnapshots
46964751

46974752
# END

0 commit comments

Comments
 (0)