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)
- Tooling shipped with VSCode
- Fail closed support
- CLI discovery of installed modules
- Investigate Rule.Exclude merge improvements
- Fix for git head in tests
- Switch to using PSResourceGet for module installation + add PSGallery as repository if not present. HOT 2
- Using 'Microsoft.Authorization/locks' custom rule, PSRule is returning the wrong 'Reason:' text when failing HOT 4
- PSRule 'Microsoft.Authorization/roleAssignments' is missing type 'properties.principalType' HOT 2
- Ability to exclude rules by tag / pillars HOT 2
- Improve version expression reason
- Fix aggregation of reasons with $Assert.AnyOf()
- `inputPath` set to `some.bicepparam` file works, but throws warning `has not been processed because no matching rules were found` HOT 3
- `Invoke-PSRule -OutputFormat 'Json'` fails if all found rules are in `RULE.EXCLUDE` HOT 1
- Baseline created by data export not found HOT 3
- Expose native logging interface to emitters
- Expose native options interface to emitters
- `Invoke-PSRule -InputPath` treats input as file unless it ends with `[System.IO.Path]::DirectorySeparatorChar`
- Using PSRule v. 3.0.0-B0203 returning unexpected ''helper'' value when testing deployment names using custom rules HOT 3
- Improve output for SARIF to make the recommendation and reason clear
- CLI exception the term Find-Module is not recognized
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.