Forum Discussion
Mervin1603
May 20, 2021Copper Contributor
Delete Spanned Drives (Dynamic Volumes) via Powershell
Hello guys,
I am relatively new to PowerShell, and I've done some research but still cannot find an answer to that.
Is there a way to delete a Spanned Volume via PowerShell?
I am able to delete Simple Volume with the command below, but this doesn't work for Spanned Volume:
Remove-Partition -DriveLetter "<Drive Letter>"
Can someone please help out ?
(I actually need to use this in an Ansible Script)
- SeshadrrIron Contributor
using command
diskpart
list volume
select volume <number>
delete volumeUsing Powershell
Get-Volume
drive letter (ex: "E")
Remove-Partition -DriveLetter "<Drive Letter>"- Mervin1603Copper Contributor
Hi Seshadrr,
Thank you for your response.I tried the PowerShell and it doesn't work:
As you can see, Drive Letter J is my Spanned Drive.
Can you help?