Skip to content

Enable-Bitlocker parameter presentation is unclear #3316

@RichMath

Description

@RichMath

When the -Pin parameter is used and the -EncryptionMethod parameter is omitted, the interpretation of the cmdlet fails with:

Enable-BitLocker : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ enable-bitlocker -whatif:$true -MountPoint X: -TpmAndPinProtecctor
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Enable-BitLocker], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Enable-BitLocker

This is the parameter set:

Enable-BitLocker
      [-MountPoint] <String[]>
      -TpmAndPinProtector
      [-Pin] <SecureString>[-EncryptionMethod <BitLockerVolumeEncryptionMethodOnEnable>]
      [-HardwareEncryption][-SkipHardwareTest]
      [-UsedSpaceOnly]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Is the rightmost "]" in the wrong place? Should the "-EncryptionMethod" parameter name be enclosed in "[" and "]" making both the <SecureString> and <BitLockerVolumeEncryptionMethodOnEnable> mandatory parameters? In the description of the -EncryptionMethod paramter says the parameter is "Named", not positional. That would seem to mean that if "-Pin" is used (even as a positional parameter) the -EncryptionMethod parameter name must be used.

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Labels

area-bitlockerIssues for bitlocker moduledoc-bugFor Upwork freelance team categories/reporting.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions