使用PowerShell卸载USB外部驱动器
我试图使用powershell卸下外部USB驱动器,我不能成功地做到这一点。 以下脚本是我使用的: #get the Win32Volume object representing the volume I wish to eject $drive = Get-WmiObject Win32_Volume -filter "DriveLetter = 'F:'" #call dismount on that object there by ejecting drive $drive.Dismount($Force , $Permanent) 然后检查我的电脑,检查驱动器是否卸下,但不是。 布尔参数$ force和$ permanent已经被尝试了不同的排列,没有用。 当params被切换时,由dismount命令返回的退出代码会改变。 (0,0) = exit code 0 (0,1) = exit code 2 (1,0) = exit code 0 (1,1) = […]