-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poor error message on some rule names #1012
Comments
@nightroman Thanks for reporting this issue. |
Interestingly this is due to path validation further down the stack with Windows PowerShell 5.1 looking for help files with the same name as the rule. The issue is not present in PowerShell 7.2. Regardless it's overdue for some validation and better guidance on rule/ resource names. Resource names should meet the following regex from PSRule v2.
|
I think it's a little harsh, if not plain "wrong". What about names in not just English? Or human friendly well readable short sentences, say, with spaces? |
@nightroman Thanks for the feedback. It warrants further thought. |
@nightroman It's not a clear as I would like, however the following regex should leave naming open without clashing with PSRule or OS specific invalid characters.
Thoughts? |
Thoughts are the more names allowed the better. But you should be reasonably strict to satisfy the current and potential future PSRule requirements. As for the regex, it looks reasonable but I cannot tell much without knowing exactly what the requirements are. |
* Fixes unclear error on invalid rule name #1012 * Integrated further community feedback * Update docs * Fix minor typo Co-authored-by: ArmaanMcleod <[email protected]>
Poor error message on some rule names
If a rule name contains some characters (not supported? documented?), for example
"
,then PSRule commands fail with cryptic messages "Illegal characters in path."
with no other details.
Steps to reproduce and actual results
(1) Create the rule script
My.Rule.ps1
(2) Invoke
Result:
(3) Invoke
Result:
Expected results
PSRule commands should either work or fail with clear error messages explaining which rule has not supported name.
Version
2.0.0 Prerelease = 'B2203033'
The text was updated successfully, but these errors were encountered: