Acerbity
Acerbity

Reputation: 527

Powershell storage cmdlets in 2012 r2

Can anyone help me with how to change the drive letter of a CDRom drive in Powershell 4? 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.

Documentation says Set-Partition is the way to go, but that only works for fixed drives.

Upvotes: 0

Views: 162

Answers (1)

Tim Ferrill
Tim Ferrill

Reputation: 1674

This isn't specific to 2012 R2, but it should still work.

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

Upvotes: 1

Related Questions