I’m trying to mount an iso without a drive letter, then specify the drive letter to use.
It works on my Windows 10 desktop but not in Windows Server 2012 R2 Standard. It should according to the documentation. I’ve tried running as me (i’m a local admin), and using runas local admin.
But using the -nodriveletter switch the iso is mounted but no information is returned by the mount to $diskImg and so the process fails.
What am I missing ?
# ISO image - replace with path to ISO to be mounted
$isoImg = 'C:\Install\SQLSERVERBUILD\en_sql_server_2012_developer_edition_with_sp2_x64_dvd_4668513.iso'
# Drive letter - use desired drive letter
$driveLetter = "Z:"
# Mount the ISO, without having a drive letter auto-assigned
$diskImg = Mount-DiskImage -ImagePath $isoImg -NoDriveLetter
# Get mounted ISO volume
$volInfo = $diskImg | Get-Volume
# Mount volume with specified drive letter (requires Administrator access)
mountvol $driveLetter $volInfo.UniqueId
@Iain
Can you Try below as well, I don’t have a test machine to test it,
the only difference in code below is that I am also passing Storage Type with Mount-DiskImage
# ISO image - replace with path to ISO to be mounted
$isoImg = ‘C:\Install\SQLSERVERBUILD\en_sql_server_2012_developer_edition_with_sp2_x64_dvd_4668513.iso’
# Drive letter - use the desired drive letter
$driveLetter = “Z:”
# Mount the ISO, without having a drive letter auto-assigned
Mount-DiskImage -ImagePath $isoImg -StorageType ISO -PassThru | Get-Volume