我想创建一个Windows Powershell脚本,通过WMI(远程)扩展我的分区,我的主机ID 10.10.10.10的IP地址
$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}
我们有任何使用Invoke-Wmimethod的方法吗?