Files
wLocal/PS/pUnlockUSB.ps1
USER 18487e6ce1 .
2024-03-14 21:52:46 +00:00

10 lines
409 B
PowerShell

Get-Content C:\Scripts\Secrets\unlockusb.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 "Z:" -Password $SecureString
#### in unlockusb.txt put below
### mystring=xxxxx