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

Verbose logging object counter does not increase #35

Closed
BernieWhite opened this issue Dec 15, 2018 · 0 comments
Closed

Verbose logging object counter does not increase #35

BernieWhite opened this issue Dec 15, 2018 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@BernieWhite
Copy link
Member

BernieWhite commented Dec 15, 2018

Description of the issues

When using Invoke-PSRule with -Verbose, additional logging is generated. PSRule should keep track of the object number that is currently being processed on the same pipeline to distinguish between different objects.

However the object counter stays at 0.

To Reproduce

Steps to reproduce the issue:

$testObject = @(
    [PSCustomObject]@{ PhoneNumber = '0400 000 000' }
    [PSCustomObject]@{ PhoneNumber = '000' }
    @{ PhoneNumber = '000' }
)

$testObject | Invoke-PSRule -Verbose;

Expected behaviour

The counter should increase from 0 for each object processed. i.e. The first object is 0, the second is 1, and so on.

Error output

VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest] ::
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest][Match]::BEGIN
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest][Match]::END
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest] -- [1/1] [Pass]
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest] ::
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest][Match]::BEGIN
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest][Match]::END
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest] -- [1/1] [Pass]
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest] ::
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest][Match]::BEGIN
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest][Match]::END
VERBOSE: [PSRule][R][0][FromFile.Rule.ps1/MatchTest] -- [0/1] [Fail]

Module in use and version:

  • Module: PSRule
  • Version: 0.1.0-B181235
@BernieWhite BernieWhite added the bug Something isn't working label Dec 15, 2018
@BernieWhite BernieWhite added this to the v0.1.0 milestone Dec 15, 2018
@BernieWhite BernieWhite self-assigned this Dec 15, 2018
BernieWhite added a commit that referenced this issue Dec 15, 2018
* Fix verbose logging counter not incrementing #35
* Fix hashtable keys should be handled as fields #36
* Improved unit test cases
* Improved GitHub issue report template
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

No branches or pull requests

1 participant