You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When rule markdown help .md is an empty file, PSRule returns an exception.
Expected behaviour
PSRule should provide a more specific error or just not return any help.
Error output
Exception :
Type : System.IndexOutOfRangeException
TargetSite : Void .ctor(System.String)
StackTrace :
at PSRule.Parser.MarkdownStream..ctor(String markdown) in /home/vsts/work/1/s/src/PSRule/Parser/MarkdownStream.cs:line 97
at PSRule.Parser.MarkdownReader.Read(String markdown, String path) in /home/vsts/work/1/s/src/PSRule/Parser/MarkdownReader.cs:line 82
at PSRule.Commands.NewRuleDefinitionCommand.TryDocument(String path, RuleDocument& document) in /home/vsts/work/1/s/src/PSRule/Commands/NewRuleDefinitionCommand.cs:line 162
at PSRule.Commands.NewRuleDefinitionCommand.GetHelpInfo(RunspaceContext context, String name) in /home/vsts/work/1/s/src/PSRule/Commands/NewRuleDefinitionCommand.cs:line 145
at PSRule.Commands.NewRuleDefinitionCommand.ProcessRecord() in /home/vsts/work/1/s/src/PSRule/Commands/NewRuleDefinitionCommand.cs:line 75
at System.Management.Automation.CommandProcessor.ProcessRecord()
Message : Index was outside the bounds of the array.
Source : PSRule
HResult : -2146233080
CategoryInfo : NotSpecified: (:) [Invoke-PSRule], IndexOutOfRangeException
FullyQualifiedErrorId : System.IndexOutOfRangeException,Invoke-PSRule
Module in use and version:
Module: PSRule
Version: 0.19.0
Captured output from $PSVersionTable:
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
The text was updated successfully, but these errors were encountered:
Description of the issue
When rule markdown help
.md
is an empty file, PSRule returns an exception.Expected behaviour
PSRule should provide a more specific error or just not return any help.
Error output
Module in use and version:
Captured output from
$PSVersionTable
:The text was updated successfully, but these errors were encountered: