Extend partition windows powershell
- by user128364
I want to create a Windows Powershell script to extend my partition through WMI (remotely), IP Address of my host id 10.10.10.10
$pass = convertto-securestring "abc123#" -asplaintext -force
$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist "10.10.10.10\Administrator",$pass
Invoke-Command -ComputerName 10.10.10.10 -Credential $myCred -ScriptBlock {"rescan","select volume 2","extend" | diskpart}
Do we have any method with use of Invoke-Wmimethod