20 lines
316 B
PowerShell
20 lines
316 B
PowerShell
param(
|
|
[switch]$KeyOnly = $false
|
|
)
|
|
|
|
if ($KeyOnly) {
|
|
(Get-BitLockerVolume -MountPoint C).KeyProtector.RecoveryPassword
|
|
}
|
|
else {
|
|
$protectors = manage-bde -protectors C: -get
|
|
if ($protectors -match 'ERROR' ) {
|
|
$protectors
|
|
exit 1
|
|
}
|
|
else {
|
|
$protectors
|
|
}
|
|
|
|
|
|
}
|