I recently needed to unlock a HDD encrypted with BitLocker a number of times. I rapidly decided that entering the password manually every time was not something I wanted to do, so for that day, I needed a command line method of doing it. Fortunately, PowerShell has a commandlet available to do this:
$SecureString = ConvertTo-SecureString "{password}" -AsPlainText -Force
Unlock-BitLocker -MountPoint "X:" -Password $SecureString
The above came from the PowerShell section of the Microsoft Docs site.
The highlighted section, including braces, should be replaced with the password for the drive.
As the PowerShell script has to have the password embedded within it, this is not something I would recommend for every day use.
Click to show/hide the PowerShell Snippets Series Index
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.
you need admin rights to do that command