Files
wLocal/PS/pUnlock.ps1
2024-02-08 14:12:50 +00:00

10 lines
402 B
PowerShell

Get-Content C:\Scripts\Secrets\unlock.txt | Where-Object {$_.length -gt 0} | Where-Object {!$_.StartsWith("#")} | ForEach-Object {
$var = $_.Split('=',2).Trim()
New-Variable -Scope Script -Name $var[0] -Value $var[1]
}
$SecureString = ConvertTo-SecureString $mystring -AsPlainText -Force
Unlock-BitLocker -MountPoint "E:" -Password $SecureString
#### in unlock.txt put below
###mystring=xxxxx