WindowsImageTools icon indicating copy to clipboard operation
WindowsImageTools copied to clipboard

Set-DiskPartition does not report a useable error

Open rvdwegen opened this issue 3 years ago • 0 comments

Expected Behavior

Report a error message that can be used to diagnose/fix whatever caused the error

Current Behavior

Currently Set-DiskPartition and the functions that use it throw a generic "Error setting partition content" without reporting why there was an error.

Possible Solution

Passthrough or hardcode the error that is actually caught.

Context

I'm using Convert-Wim2VHD in a VM creation script, usually it works perfectly but recently I had to run it on a machine that had an Intune policy set to prevent writing to non-bitlocker drives (including apparently mounted image files). I could only find out this was the cause after editing the psm1 file to include Write-Host $_.Exception commands before the Write-Error around line 1190 that replaced the actual error message.

rvdwegen avatar Jan 14 '22 04:01 rvdwegen