Hi Greg,
It seems unfortunate that you can't specify the drive letter directly
with Mount-DiskImage
It can be set though, with a bit of mucking around and without the need
for a dummy drive letter first:
$ImagePath =
'R:\en_sql_server_2014_enterprise_core_edition_x64_dvd_3935310.iso'
$Volume = Mount-DiskImage -ImagePath $ImagePath -NoDriveLetter -PassThru
| Get-Volume;
$Filter = "DeviceID = '$($Volume.Path.Replace('\','\\'))'"
Get-WmiObject -Class Win32_Volume -Filter $Filter |% { $_.DriveLetter =
'Z:'; $_.Put() }
The Get-Volume cmdlet returns a MSFT_Volume CIM class with a DriveLetter
property, however it's readonly.
cheers,
Tony
On 17/01/2016 10:17, Greg Low (罗格雷格博士) wrote:
Hi Folks,
Anyone know how to do either of the following via Powershell:
·Mount an ISO as a specific drive letter
·Change the drive letter of a mounted ISO
Mount-DiskImage doesn’t seem to have any option for choosing a drive
letter.
Set-Partition doesn’t seem to recognise a mounted ISO as a partition.
Regards,
Greg
Dr Greg Low
1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676
4913 fax
SQL Down Under| Web: www.sqldownunder.com <http://www.sqldownunder.com/>