Skip to content

ConvertTo-SecureString -AsPlainText doesn't always require -Force #8796

@ishepherd

Description

@ishepherd

Prerequisites

  • Write a descriptive title.
  • Search the existing issues.

Summary of the new feature or changed behavior

To use the AsPlainText parameter, the Force parameter must also be included in the command.

That's not correct, on my local desktop. Example below.

However it is true when running my build on Azure Pipelines - my build just broke.

Please add some detail around when it is needed, and when it isn't? Thankyou.


PS C:\Code> $bar = ConvertTo-SecureString -AsPlainText 'foo'

PS C:\Code> $bar.GetType()


IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     False    SecureString                             System.Object

PS C:\Code> $PSVersionTable.PSVersion


Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      1      2

List of articles that need to be updated

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/convertto-securestring?view=powershell-7.1#example-3-convert-a-plain-text-string-to-a-secure-string

Link to related PR in PowerShell/PowerShell repo

n/a

Link to related Issues in PowerShell/PowerShell repo

n/a

Metadata

Metadata

Labels

area-securityArea - Security module and conceptsissue-doc-bugIssue - error in documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions