Summary
Here is a comprehensive guide to overwriting volumes in Windows Server using the Pure Storage PowerShell SDK, with updated instructions for leveraging the latest features and best practices for FlashArray management.
In this example I have a Windows Server 2016 system that has several volumes connected using Fibre Channel, the same steps apply if you are using iSCSI. The volume that I will be working with is PSRepository. This is an PowerShell Gallery folder that contains .ps1 file.

The steps to perform an overwrite:
(1) Connect to the FlashArray
1 2 3 4 5 |
PS C:> $FlashArray = New–PfaArray –EndPoint 10.21.8.202 –Credentials (Get–Credential) –IgnoreCertificateError cmdlet Get–Credential at command pipeline position 1 Supply values for the following parameters: Credential |
(2) Check the connection to the FlashArray. Optional step, just illustrating here that we have a connection to the FlashArray.
1 2 3 4 5 6 7 8 |
PS C:> $FlashArray Disposed : False EndPoint : 10.21.8.202 UserName : pureuser ApiVersion : 1.7 Role : ArrayAdmin ApiToken : 58db6abf–1933–553f–1628–0c6e207aba1e |
(3) Retrieve the volume. Optional step as I just want to illustrate the volume exists on the FlashArray.
1 2 3 4 5 |
PS C:> Get–PfaVolumes –Array $FlashArray | Where–Object { $_.name –like ‘*PS*’ } | Format–Table –AutoSize source serial created name size ——— ——— ———– —— —— 45084F3508BF4614000111A7 2016–11–02T16:21:05Z PSRepository 268435456000 |
(4) Create a snapshot of the PSRepository volume. For this example I use the Suffix and set to Overwrite. This is the snapshot we will restore (overwrite) in a few steps.
1 2 3 4 5 6 7 |
PS C:> New–PfaVolumeSnapshots –Array $FlashArray –Sources PSRepository –Suffix Overwrite source : PSRepository serial : 45084F3508BF461400011AC1 created : 2017–05–12T16:51:46Z name : PSRepository.Overwrite size : 268435456000 |
To prove the overwrite operation takes place I have made copies of the Untitled.ps1 files into the same folder.
Try out FlashBlade

(5) Offline the Windows Server volume.
1 2 |
$Volume = Get–PfaVolume –Array $f –Name ‘PSRepository’ Get–Disk –SerialNumber $Volume.serial | Set–Disk –IsOffline $true |
(6) Perform the overwrite operation with the snapshot we named PSRepository.Overwrite
1 2 3 4 5 6 7 |
PS C:> New–PfaVolume –Array $FlashArray –Source PSRepository.OverWrite –VolumeName PSRepository –Overwrite source : PSRepository serial : 45084F3508BF4614000111A7 created : 2017–05–12T16:51:46Z name : PSRepository size : 268435456000 |
(7) Online the Windows Server volume.
1 2 |
$Volume = Get–PfaVolume –Array $f –Name ‘PSRepository’ Get–Disk –SerialNumber $Volume.serial | Set–Disk –IsOffline $false |
From the screenshot below you can see the the original snapshot has overwritten the volume where we had made copies of the .ps1 files.

Using the Latest Pure Storage PowerShell SDK for Volume Overwrites in Windows Server
With the advancements in the Pure Storage PowerShell SDK, managing FlashArray volumes in Windows Server environments has become even more streamlined and efficient. Below is a guide on using the updated SDK (version 2.16 or later) for overwriting volumes while leveraging the latest features.
Prerequisites
- Install or Update the SDK: Ensure you have the latest version of the Pure Storage PowerShell SDK installed. You can download or update it from the PowerShell Gallery.powershellCopyEdit
Install-Module -Name PureStorage.FlashArray -AllowClobber -Force
- Connect to Your FlashArray: Use the
Connect-PfaArray
cmdlet to authenticate and establish a connection with your FlashArray.powershellCopyEdit$FlashArray = Connect-PfaArray -EndPoint "flasharray.example.com" -UserName "admin" -Password "YourPassword"
Overwriting a Volume with the Latest Cmdlets
- Locate the Target Volume: Use the
Get-PfaVolume
cmdlet to list all volumes and identify the one you want to overwrite.powershellCopyEditGet-PfaVolume
- Create a New Volume: If you need a fresh volume to overwrite, use the
New-PfaVolume
cmdlet. This ensures the overwrite operation is applied to the correct volume.powershellCopyEditNew-PfaVolume -Name "NewVolume" -Size 500GB -Array $FlashArray
- Perform the Overwrite: Use the
Write-PfaVolumeData
cmdlet to perform the overwrite operation. This cmdlet ensures the volume is overwritten securely.powershellCopyEditWrite-PfaVolumeData -VolumeName "TargetVolume" -Pattern "0xFF" -PassCount 1 -Array $FlashArray
-Pattern
: Specifies the byte pattern to use for overwriting (e.g.,0xFF
for all ones).-PassCount
: Defines how many times the volume should be overwritten.
- Verify the Overwrite: Once the overwrite is complete, validate the operation using
Get-PfaVolumeData
.powershellCopyEditGet-PfaVolumeData -VolumeName "TargetVolume" -Array $FlashArray
Additional Tips
- Snapshot Integration: Use the
Get-PfaSnapshot
cmdlet to list snapshots of the volume before overwriting, ensuring critical data is preserved if needed.powershellCopyEditGet-PfaSnapshot -VolumeName "TargetVolume" -Array $FlashArray
- Automation: Leverage PowerShell scripts to automate volume management and overwriting tasks across multiple environments.
Benefits of Using the Latest SDK
- Enhanced Security: The updated SDK ensures compliance with modern security standards, making volume overwrites more secure.
- Improved Performance: New cmdlets are optimized for better performance, especially when managing large datasets or multiple volumes.
- Ease of Use: Enhanced logging and error-handling capabilities make troubleshooting and management more straightforward.
By utilizing the latest Pure Storage PowerShell SDK, you can simplify volume management in Windows Server environments while ensuring compatibility with modern storage and security practices.

Pure Storage Virtual Lab