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 } }