Skip to content

New-PSRuleOption -OutputOutcome does not accept Problem #2542

@nightroman

Description

@nightroman

Description of the issue

New-PSRuleOption -OutputOutcome does not accept the argument Problem or "Fail,Error".

At the same time the documentation describes Problem
https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#outputoutcome

and this workaround works, too: New-PSRuleOption -Option @{ 'Output.Outcome' = 'Fail,Error' }

To Reproduce

Steps to reproduce the issue:

New-PSRuleOption -OutputOutcome Problem

Expected behaviour

The command returns the required option.

Error output

New-PSRuleOption: Cannot validate argument on parameter 'OutputOutcome'. The argument "Problem" does not belong to the set "None,Fail,Pass,Error,Processed,All" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.

Module in use and version:

  • Module: PSRule
  • Version: 2.9.0

Captured output from $PSVersionTable:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeature: optionsIssues that affect options

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions