问题
How to extend volume using powershell (I prefer WMI over powershell remoting) on remote computer ?
OS is win XP sp3.
回答1:
I ended up with somethin like this:
Invoke-Command -ComputerName $compName -Credential $compCred -ScriptBlock {"rescan","select volume 2","extend" | diskpart}
I'm still looking for better solution, if there is one.
回答2:
There is a set of scripts Microsoft's Storage Team wrote to handle this that can also be hooked into System Insights as automated remediation actions:
https://blogs.technet.microsoft.com/filecab/2018/06/19/creating-remediation-actions-for-system-insights/
You can also see my answer with PowerShell function here, in Remotely extend a partition using WMI:
来源:https://stackoverflow.com/questions/4797173/how-to-extend-volume-using-powershell