Skip to content

Cannot process argument because the value of argument "name" is not valid #1723

@BernieWhite

Description

@BernieWhite

Discussed in #1722

Originally posted by paulmcclbg January 3, 2024
If I run the following:

Assert-PSRule -InputPath ./test-sample-1.json -Module PSRule.Rules.Azure

then the command runs fine and I get rule results outputted to the terminal (8 passed, 2 failed)

As soon as I change to

Invoke-PSRule -InputPath ./test-sample-1.json -Module PSRule.Rules.Azure
I get this error:

format-default: Cannot process argument because the value of argument "name" is not valid. Change the value of the "name" argument and run the operation again.

Can you please explain ? I want to use Invoke-PSRule due to invokation through Pester.

Note: Test-PSRuleTarget also runs fine and returns False.

There is an issue with the default formatting configuration in

<View>
<Name>PSRule.Rules.RuleRecord</Name>
<ViewSelectedBy>
<TypeName>PSRule.Rules.RuleRecord</TypeName>
</ViewSelectedBy>
<GroupBy>
<PropertyName>TargetName</PropertyName>
</GroupBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label AssemblyName="Microsoft.PSRule.Core" BaseName="PSRule.Resources.ViewStrings" ResourceId="RuleName"/>
<Width>35</Width>
</TableColumnHeader>
<TableColumnHeader>
<Label AssemblyName="Microsoft.PSRule.Core" BaseName="PSRule.Resources.ViewStrings" ResourceId="Outcome"/>
<Width>10</Width>
</TableColumnHeader>
<TableColumnHeader>
<Label AssemblyName="Microsoft.PSRule.Core" BaseName="PSRule.Resources.ViewStrings" ResourceId="Recommendation"/>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Outcome</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Recommendation</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationfeature: outputIssues that affect output and resultsupstreamAn issue for upstream tracking of PSRule dependencies

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions