Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disk shrink failure from missing disk image and partition objects #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jan 28, 2022

  1. Fix exception logic to preserve partition/mount vars

    For some reason, `Mount-DiskImage` passthru will sometimes have a null value for the `DiskNumber` property, so this is piped into `Get-DiskImage`  to preserve all properties. 
    
    Partition information (`$partinfo`) would fail silently, because when `Get-Partition -DiskNumber $mountedDisk.Number -ErrorAction Stop` only returns `$null`, but does not register as an exception, so the `catch {}` blocks would never fire. Instead, this is now partially handled through if statements.
    
    Without these changes, in certain cases the script would execute, but not actually shrink any disks, and it would output that it could not get partition information in the logfile.
    4oo4 committed Jan 28, 2022
    Configuration menu
    Copy the full SHA
    1bb37f1 View commit details
    Browse the repository at this point in the history