`Set-ScheduledTask` shouldn't accept a plain text Password · Issue #16502 · PowerShell/PowerShell · GitHub
Skip to content

Set-ScheduledTask shouldn't accept a plain text Password #16502

@iRon7

Description

@iRon7

Prerequisites

Steps to reproduce

Along with the common security rules and defined by e.g. PSScriptAnalyzer rule PSAvoidUsingPlainTextForPassword:

Parameter '$Password' should use SecureString,
otherwise this will expose sensitive information.
See ConvertTo-SecureString for more information.

Related: StackOverflow: Hide not the output but the actual command containing sensitive info in devops logs

Expected behavior

Have a [PSCredential] parameter instead

Actual behavior

Set-ScheduledTask accepts a plain text password ([[-Password] <String>])

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.0
PSEdition                      Core
GitCommitId                    7.2.0
OS                             Microsoft Windows 10.0.22000
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

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-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