Created
January 27, 2024 08:28
-
-
Save gladiopeace/68be4f3363c2f1e8cba8fca59e000785 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires running as Administrator | |
# This is a simplified example and may need modifications to work in your environment | |
$windowsInstallations = Get-WindowsInstallations # Custom function to detect Windows installations | |
foreach ($install in $windowsInstallations) { | |
$description = "Windows on " + $install.DriveLetter | |
$guid = (bcdedit /copy {current} /d $description).Trim().Split(" ")[2] | |
bcdedit /set $guid device partition=$install.DriveLetter | |
bcdedit /set $guid osdevice partition=$install.DriveLetter | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment