Restart-Computer (with BitLocker Suspended)

Create a function called Restart-Computer. Use it to call the Restart-Computer cmdlet. Before you call the cmdlet, suspend bitlocker protection so you don't get password-pestered at boot time...


function Restart-Computer {

    Suspend-BitLocker -MountPoint "C:" -RebootCount 1


Why does this work?
There are rules for command precedence...


These rules determine which command to run when there is more than one command with the same name. And... if the same type of command with the same name exists, PowerShell runs the command that was added to the session most recently.

Comments (0)

Skip to main content