【发布时间】:2020-03-03 17:49:33
【问题描述】:
我的系统上有一些 SD 卡或可移动媒体驱动器,默认情况下使用 D 驱动器号。
我有这个:
PS C:\Windows\System32\WindowsPowerShell\v1.0> get-volume | where DriveType -Match "Removable"
DriveLetter FileSystemLabel FileSystem DriveType HealthStatus SizeRemaining Size
----------- --------------- ---------- --------- ------------ ------------- ----
E Removable Healthy 0 B 0 B
我想像这样把它改成 G:
PS C:\Windows\System32\WindowsPowerShell\v1.0> get-volume | where DriveType -Match "Removable" |Set-Partition -NewDriveLetter G
但我明白了:
Set-Partition : 传递给方法的一个或多个参数值无效。 在行:1 字符:50 + ... |其中 DriveType -匹配“可移动”|Set-Partition -NewDriveLetter G + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (PS_StorageCmdlets:ROOT/Microsoft/..._StorageCmdlets) [Set-Partition], 异常 +fullyQualifiedErrorId : MI RESULT 4,Set-Partition
我该如何改变呢?或者是什么问题?我尝试使用 get-disk 来通过,但也不起作用。 我可以在计算机管理 gui 中进行更改,但我需要命令行。
【问题讨论】:
标签: windows powershell scripting