Closed LaurentDardenne closed 5 years ago
@LaurentDardenne Yeah, so Get-PSRuleHelp
searches rules in loaded modules first. The intent was to match similar functionality to Get-Help
.
The reasoning for this was that modules are more likely to have markdown help created for them then standalone rules.
-Path
can be used, but it is more explicit.
This this behaviour may be confusing since, most of the other PSRule cmdlets operate on the current working path first.
However i'm interested in your feedback to improve this in the future.
However i'm interested in your feedback to improve this in the future.
According to the documentation:
If the rules are loose (not part of a module), PSRule will search for documentation in the .\
\ subdirectory relative to where the rule script .ps1 file is located.
If one is already in the directory of a script of a rule, I think that if Path is not informed one can first search the help file in the current directory before displaying an error s' he does not exist. I have not yet studied the creation of modules of rule, but already I know one of the advantages.
The cmdlet Get-PSRuleHelp must search into the current directory if the 'Path' parameter has no argument :
One rule file exist into the current directory, but Get-PSRuleHelp do not read it :
When I specify the 'Path' parameter with a relative path, it finds the help file
That said, research in the current path can often be problematic with Powershell :