Skip to content

Unlock-Bitlocker/Lock-Bitlocker excessive confirmation queries #25878

@AGDownie

Description

@AGDownie

Prerequisites

Steps to reproduce

I am using the Unlock-Bitlocker and Lock-Bitlocker cmdlets to automate the unlocking/locking of multiple encrypted external drives.

According to the cmdlet help, the -Confirm option "Prompts you for confirmation before running the cmdlet.". However, when -Confirm is used on either of these cmdlets, an excessive number of confirmation queries are issued for obscure CIM-related actions internal to the cmdlet.

The following is a log of the messages received when unlocking a single drive:

PS> Unlock-BitLocker H: -Password $password -Confirm

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetLockStatus" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetEncryptionMethod" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: IsAutoUnlockEnabled" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: IsAutoUnlockKeyStored" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetVersion" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetProtectionStatus" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetKeyProtectors" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetKeyProtectorType" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetKeyProtectorType" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Unlock-BitLocker" on target "H:".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: UnlockWithPassphrase" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetLockStatus" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetEncryptionMethod" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: IsAutoUnlockEnabled" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: IsAutoUnlockKeyStored" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetVersion" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetConversionStatus" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetProtectionStatus" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetKeyProtectors" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetKeyProtectorType" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetKeyProtectorType" on target "Win32_EncryptableVolume (DeviceID =
"\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-CimMethod: GetKeyProtectorNumericalPassword" on target "Win32_EncryptableVolume
(DeviceID = "\\?\Volume{10380489-0000-0000-007e-0000...)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

   ComputerName: DAN14

VolumeType      Mount CapacityGB VolumeStatus           Encryption KeyProtector              AutoUnlock Protection
                Point                                   Percentage                           Enabled    Status
----------      ----- ---------- ------------           ---------- ------------              ---------- ----------
Data            H:      1,863.01 FullyEncrypted         100        {Password, RecoveryPassw… False      On

Expected behavior

A single confirmation query to perform the intended unlock operation:

PS> Unlock-BitLocker H: -Password $password -Confirm

Confirm
Are you sure you want to perform this action?
Performing the operation "Unlock-Bitlocker" on target "H:".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Actual behavior

An excessive number of CIM-related confirmation requests, each of which has to be responded to separately (A for All doesn't work).  

See the issue description for details of the requests made.

Note that the confirmation query in the expected behavior IS included in the series of queries somewhere around the half-way point in the execution.

Error details

N/A

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.2
PSEdition                      Core
GitCommitId                    7.5.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-ExternalThe issue is caused by external component(s).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions