Created
October 29, 2025 17:57
-
-
Save tkuennen/6e3898c4738a2abb904e35833a4b244c to your computer and use it in GitHub Desktop.
Windows 11 Disable Bitlocker sysprep
This file contains hidden or 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
| Disable-BitLocker -MountPoint "C:" -erroraction silentlycontinue | |
| $bl = Get-BitLockerVolume -MountPoint "c:" | select-object -expandproperty VolumeStatus | |
| Do {Get-BitLockerVolume -MountPoint "c:" | select-object -expandproperty VolumeStatus | out-null} Until ($bl = "FullyDecrypted") | |
| $sizemin = Get-PartitionSupportedSize -driveletter c | select-object -expandproperty SizeMin | |
| $result = $sizemin / 10 | |
| $final = $sizemin + $result | |
| Resize-Partition -driveletter c -size $final | |
| Import-Module Appx | |
| Import-Module Dism | |
| Get-AppxPackage -allusers | Remove-AppxPackage -erroraction silentlycontinue | |
| Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce' -name 'firstlogon' -value 'powershell -noexit -ep bypass c:\users\admin\sysprep\firstlogon.ps1' | |
| start-process 'C:\Windows\System32\Sysprep\sysprep.exe' -argumentlist /oobe, /generalize, /shutdown, /unattend:C:\Users\admin\sysprep\unattend.xml -wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment