Skip to content

Set-DiskPartition does not report a useable error #15

@rvdwegen

Description

@rvdwegen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions