Comments (5)
Thanks @avernigora-clgx for raising an issue. The output you have in the screenshot is expected.
In the summary view today passing rules are compacted into a single item for each resource and errored or failed rules are shown with details.
In the detailed view, each passing or failing/ erroring rule is shown.
While this is the current functionality, what would you like to see in future iterations to make this better?
Also it's worth noting that Assert-PSRule
and Invoke-PSRule
perform similar functions but display output differently. Assert-PSRule
is intended for output in a DevOps pipeline where there is no interactivity of the output but you need as much detail as possible for any issues.
With Invoke-PSRule
is follows normal powershell conventions so you can easily filter out data or change the view.
from psrule.
Thanks for raising your first issue, the team appreciates the time you have taken 😉
from psrule.
Perhaps in this case it is a good idea to update documentation, as I expected to se the summary table, as it is described in the doc
from psrule.
But my personal feeling is that it would be great if smth like this worked
$rx = assert-PSRule -InputPath .\hub\main.non-prod.bicepparam -Module 'PSRule.Rules.Azure' -Format File -Baseline 'Azure.Default' -As Summary -Option $option
$rx | where status -eq 'Failed'
So I can work with these outputs as they were normal .net objects
from psrule.
But my personal feeling is that it would be great if smth like this worked
$rx = assert-PSRule -InputPath .\hub\main.non-prod.bicepparam -Module 'PSRule.Rules.Azure' -Format File -Baseline 'Azure.Default' -As Summary -Option $option $rx | where status -eq 'Failed'So I can work with these outputs as they were normal .net objects
@avernigora-clgx For this, use Invoke-PSRule
which provides .NET objects as is expected in PowerShell.
As mentioned, Assert-PSRule
is for DevOps pipelines and integration into Visual Studio Code which only understand text, so formatted output is required.
With Invoke-PSRule
you absolutely can do something like | where Outcome -eq 'Fail'
in the detailed view (not summary). You could apply you own custom formatting.
I think for the most part the docs shows Invoke-PSRule
with the -As Summary
. If there is a specific part in the docs that was unclear let me know.
Also both Assert-PSRule
and Invoke-PSRule
support filtering outcome (status) as parameter -Outcome
. i.e. -Outcome Fail
or -Outcome Fail,Error
.
from psrule.
Related Issues (20)
- bug: csv output of recommendation will result in wrong rows because of new lines HOT 2
- Bump tooling to .NET 7
- Challenges with nullable types HOT 8
- Add lock file support
- Cast exception when expanding the union of an array and an AccessPolicyEntry[] HOT 4
- CLI IndexOutOfRangeException with lock file
- Improve support for match to process an array of string
- Add outcome argument for CLI
- Simplify usage of running analysis
- Cannot process argument because the value of argument "name" is not valid HOT 3
- Add commands to list locked modules
- Move restore to module command
- CLI takes a long time to return when a file cant be found
- Include effective configuration in SARIF output
- Include source file hashes in SARIF
- Allow disabling PowerShell features that can be run from a repository
- CLI null reference when include module is undefined
- Investigate Input.IgnoreObjectSource bug
- Tooling shipped with VSCode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psrule.