Forum Discussion

Mervin1603's avatar
Mervin1603
Copper Contributor
May 20, 2021

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)

 

  • Seshadrr's avatar
    Seshadrr
    Iron Contributor

    using command

    diskpart
    list volume
    select volume <number>
    delete volume

     

    Using Powershell

     

    Get-Volume
    drive letter (ex: "E")
    Remove-Partition -DriveLetter "<Drive Letter>"

    • Mervin1603's avatar
      Mervin1603
      Copper 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?

Resources