How to extend a logical volume using Powershell

6,348

On my local computer I would do this by piping the commands to diskpart:

PS> $a = "select disk 0","select volume 0","extend" | diskpart
PS> write-host $a

Maybe you can build on this to achieve the desired result on the remote computer

Share:
6,348

Related videos on Youtube

Primoz
Author by

Primoz

Updated on September 17, 2022

Comments

  • Primoz
    Primoz over 1 year

    On Windows XP SP3, how can I extend a volume using Powershell on a remote computer?

    I prefer WMI over Powershell remoting.

  • Primoz
    Primoz over 13 years
    Current solution: Invoke-Command -ComputerName $compName -Credential $compCred -ScriptBlock {"rescan","select volume 2","extend" | diskpart}