-
Notifications
You must be signed in to change notification settings - Fork 52
MountImage
dscbot edited this page Mar 16, 2024
·
7 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
ImagePath | Key | String | Specifies the path of the VHD or ISO file. | |
DriveLetter | Write | String | Specifies the drive letter to mount this VHD or ISO to. | |
StorageType | Write | String | Specifies the storage type of a file. If the StorageType parameter is not specified, then the storage type is determined by file extension. |
ISO , VHD , VHDx , VHDSet
|
Access | Write | String | Allows a VHD file to be mounted in read-only or read-write mode. ISO files are mounted in read-only mode regardless of what parameter value you provide. |
ReadOnly , ReadWrite
|
Ensure | Write | String | Determines whether the VHD or ISO should be mounted or not. |
Present , Absent
|
The resource is used to mount or unmount an ISO/VHD disk image. It can be mounted as read-only (ISO, VHD, VHDx) or read/write (VHD, VHDx).
This configuration will unmount the ISO file 'c:\Sources\SQL.iso' if mounted as a drive.
configuration MountImage_DismountISO
{
Import-DscResource -ModuleName StorageDsc
MountImage ISO
{
ImagePath = 'c:\Sources\SQL.iso'
Ensure = 'Absent'
}
}
This configuration will mount an ISO file as drive S:.
configuration MountImage_MountISO
{
Import-DscResource -ModuleName StorageDsc
MountImage ISO
{
ImagePath = 'c:\Sources\SQL.iso'
DriveLetter = 'S'
}
WaitForVolume WaitForISO
{
DriveLetter = 'S'
RetryIntervalSec = 5
RetryCount = 10
}
}
This configuration will mount a VHD file and wait for it to become available.
configuration MountImage_MountVHD
{
Import-DscResource -ModuleName StorageDsc
MountImage MountVHD
{
ImagePath = 'd:\Data\Disk1.vhd'
DriveLetter = 'V'
}
WaitForVolume WaitForVHD
{
DriveLetter = 'V'
RetryIntervalSec = 5
RetryCount = 10
}
}