dsccommunity / StorageDsc

DSC resource module is used to manage storage on Windows Servers.
https://dsccommunity.org
MIT License
69 stars 51 forks source link

MSFT_MountImage - Dismounting an image fails Window Server 2019 #221

Closed wsmelton closed 3 years ago

wsmelton commented 4 years ago

https://github.com/dsccommunity/StorageDsc/blob/dev/Examples/Resources/MountImage/1-MountImage_DismountISO.ps1

Use the above example does not seem to work for me on Windows Server 2019 with an ISO mounted to drive Z:

configuration MountImage_DismountISO
{
    Import-DscResource -ModuleName StorageDsc

    MountImage ISO
    {
        ImagePath = 'c:\software\SQLServer2019-x64-ENU-Dev.iso'
        DriveLetter = 'Z'
        Ensure = 'Absent'
    }
}

The error returned:

PowerShell DSC resource MSFT_MountImage  failed to execute Test-TargetResource functionality with error message:
System.InvalidOperationException: Ensure is 'Absent' but 'DriveLetter' was specified.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure
    + PSComputerName        : localhost