Overwriting a Volume in Windows Server

I have been asked the question about how do you overwrite a volume using the PowerShell SDK that is connected from a Windows Server a few times so here is how its done!

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

(2) Check the connection to the FlashArray. Optional step, just illustrating here that we have a connection to the FlashArray.

(3) Retrieve the volume. Optional step as I just want to illustrate the volume exists on the FlashArray.

(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.

To prove the overwrite operation takes place I have made copies of the Untitled.ps1 files into the same folder.

(5) Offline the Windows Server volume.

(6) Perform the overwrite operation with the snapshot we named PSRepository.Overwrite

(7) Online the Windows Server volume.

From the screenshot below you can see the the original snapshot has overwritten the volume where we had made copies of the .ps1 files.

Go forth and automate!