Skip to content

Possible to suppress PSRule output in terminal completely and output as a JSON-file #1863

Answered by BernieWhite
lassehastrup asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @lassehastrup, Thanks for the question. For integrating with PowerShell tools try Invoke-PSRule.

Assert-PSRule is intended to provide a CI/CD friendly output to pipelines as text.

Invoke-PSRule will output native PowerShell objects that can be tested with Pester. It accepts almost identical parameters and supports ps-rule.yaml same as Assert-PSRule.

PSRule for Azure has a number of examples of this. See: https://github.com/Azure/PSRule.Rules.Azure/blob/main/tests/PSRule.Rules.Azure.Tests/Azure.ACR.Tests.ps1


Also note there is a few deprecations for the future v3 release to be aware of: https://microsoft.github.io/PSRule/v3/deprecations/


I hope that answers the question.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lassehastrup
Comment options

Answer selected by lassehastrup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants