-
Notifications
You must be signed in to change notification settings - Fork 52
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
Disk: Does specifying an existing partition letter without a size expand the partition to use the remaining free space on the drive #162
Comments
I assume that you don't want to specify the Feels that the scenario you looking for is not tested among those "AllowDestructive" tests. Closest is this one; https://github.com/PowerShell/StorageDsc/blob/b31dbc236c6c7542f344a3eee5b8aa6b6055d0f4/Tests/Unit/MSFT_Disk.Tests.ps1#L1663-L1722 I think we should add a test for that scenario. Hoping someone in the community can answer this better. /cc @PlagueHO |
Not the entire disk - if there's another partition on the disk we don't want to delete it. That's what I mean by "remaining free space", the unpartitioned space remaining on the disk. Other than that, yes I want it to resize the partition with I also didn't see any tests that cover this case and, like I said, I'm pretty sure the behavior is at the whim of how Resize-Partition handles Size being |
This sounds like a bug, labeling it as such, and help wanted so that anyone in the community can run with this. |
It does indeed look like this is a bug and should be able to be fixed fairly easily by setting |
This has required a bit more to it than what I first thought. Hopefully won't be much longer. Needed a lot more new tests to really validate that this isn't going to break anything. |
Enable Disk Partition Resize when Size not specified - Fixes #162
This is a question about the existing functionality.
Can we use this to resize a volume to use the remaining free space of a drive in addition to its existing space?
We would like to use this to resize partitions on VMs if the virtual disk has been resized. The wiki documentation says regarding Size: "Specifies the size of new volume. Leave empty to use the remaining free space."
However, reading the code for MSFT_Disk's handling of existing partitions, it looks like if size is not specified it might try to resize the partition to $null because $Size hasn't been set and $null is not equal to $assignedPartition.Size. At this point, behavior is up to if Resize-Partition errors when the -Size parameter is $null.
The text was updated successfully, but these errors were encountered: