Update Ensure-RealBitLockerKey.ps1
This commit is contained in:
@@ -95,8 +95,19 @@ function Ensure-RealBitLockerKey {
|
||||
$auditString = $null
|
||||
if ($PersistToRegistry) {
|
||||
# Build audit
|
||||
$alert = $env:usrAlert -match 'true' ? 'Notice' : 'Status'
|
||||
$t = Get-Tpm; $mask = ($t.TpmPresent?1:0) + ($t.TpmReady?6:0)
|
||||
# Powershell 7
|
||||
#$alert = $env:usrAlert -match 'true' ? 'Notice' : 'Status'
|
||||
|
||||
# powershell 5
|
||||
if ($env:usrAlert -match 'true') {
|
||||
$alert = 'Notice'
|
||||
} else {
|
||||
$alert = 'Status ...'
|
||||
}
|
||||
|
||||
$t = Get-Tpm; $mask = (if ($t.TpmPresent) { 1 } else { 0 }) + (if ($t.TpmReady) { 6 } else { 0 })# PoSH 7 $mask = ($t.TpmPresent?1:0) + ($t.TpmReady?6:0)
|
||||
|
||||
|
||||
switch ($mask) {0{'Absent'};1{'Disabled'};3{'Deactivated'};7{'Active'};default{'Error'}} | Out-Null
|
||||
$drives=$AllDisks?($targets):(,$d)
|
||||
$diskStatus=''
|
||||
|
||||
Reference in New Issue
Block a user