Giter Site home page Giter Site logo

Comments (3)

BernieWhite avatar BernieWhite commented on June 9, 2024 1

Thanks for the detail @tonyskidmore.

Currently we believe this is a regression introduced in PS 7.4.x. PowerShell/PowerShell#21147

The issue affects the default view set by PSRule. The issue is noticable when running with the cmdlet interactively, and shouldn't affect most automated pipelines.

As a workaround until the fix ships you can update your command-line to select the specific properties you want as follows:

Invoke-PSRule -InputPath "$PWD/out/" -Module 'PSRule.Rules.Azure' | Select-Object RuleName, Outcome, Recommendation

from psrule.

tonyskidmore avatar tonyskidmore commented on June 9, 2024

@BernieWhite I have just started looking at PSRule and have come across this issue trying to get started using PowerShell 7.4.1.

Export-AzRuleData -OutputPath "$PWD/out/"
Invoke-PSRule -InputPath "$PWD/out/" -Module 'PSRule.Rules.Azure'

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.

If I run the same command from PowerShell 7.3..11 it works, i.e., I see output:

cmd.exe
cd C:\tools\PowerShell-7.3.11
pwsh

Get-Host

Name             : ConsoleHost
Version          : 7.3.11
InstanceId       : 0faf6a9e-eab1-47d2-aa9e-95ce70c48f2e
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-GB
CurrentUICulture : en-GB
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Invoke-PSRule -InputPath "$PWD/out/" -Module 'PSRule.Rules.Azure'

The problem for me is this is running in CD agents that have PowerShell 7.4.1 installed by default and I didn't want to start building containers just to do some initial POC testing in a pipeline.

from psrule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.