简体   繁体   English

2012 R2中的Powershell存储cmdlet

[英]Powershell storage cmdlets in 2012 r2

Can anyone help me with how to change the drive letter of a CDRom drive in Powershell 4? 谁能帮助我更改Powershell 4中CDRom驱动器的驱动器号? I know it can be done with a GWMI call, but they have added a lot of storage related functionality in 4/2012 r2 and I am not able to figure out how it is done. 我知道可以通过GWMI调用来完成此操作,但是他们在4/2012 r2中添加了许多与存储相关的功能,但我不知道该如何完成。

Documentation says Set-Partition is the way to go, but that only works for fixed drives. 文档说设置分区是一种可行的方法,但是仅适用于固定驱动器。

This isn't specific to 2012 R2, but it should still work. 这不是特定于2012 R2,但它仍然可以正常工作。

$drive = Get-WmiObject -Class win32_volume -Filter "DriveLetter = 'e:'"
Set-WmiInstance -input $drive -Arguments @{DriveLetter="X:"}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM