Skip to content
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

Invoke-PSRule hangs if JSON rule file is empty #969

Closed
ArmaanMcleod opened this issue Feb 8, 2022 · 0 comments · Fixed by #971
Closed

Invoke-PSRule hangs if JSON rule file is empty #969

ArmaanMcleod opened this issue Feb 8, 2022 · 0 comments · Fixed by #971
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ArmaanMcleod
Copy link
Contributor

Description of the issue

When running Invoke-PSRule with a .jsonc rule file, if the file is empty it hangs. Works fine when an empty array exists in the file.

To Reproduce

Steps to reproduce the issue:

$testObject = [PSCustomObject]@{
    Name = 'TestObject1'
    Value = 1
}

$jsonFilePath = ".\FromFile.Rule.jsonc" # Empty file

$testObject | Invoke-PSRule -Path $jsonFilePath # Hangs

Expected behaviour

Should not hang.

Error output


Module in use and version:

  • Module: PSRule
  • Version: v2.0.0-B2202024

Captured output from $PSVersionTable:

Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional context

@ArmaanMcleod ArmaanMcleod self-assigned this Feb 8, 2022
@ArmaanMcleod ArmaanMcleod added the bug Something isn't working label Feb 8, 2022
@ArmaanMcleod ArmaanMcleod added this to the v2.0.0 milestone Feb 9, 2022
@BernieWhite BernieWhite mentioned this issue Mar 25, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant