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

Informational messages are not reported to host #48

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

Informational messages are not reported to host #48

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

Comments

@BernieWhite
Copy link
Member

Description of the issue

Informational messages are not reported to host under the following conditions:

  • Verbose, information, warning and error messages within rule definition blocks
  • General verbose, information and warning messages within .Rule.ps1 scripts outside of rule definitions

To Reproduce

Steps to reproduce the issue:

# Logging in main script
Write-Information -MessageData 'Script information message';
Write-Verbose -Message 'Script verbose message';
Write-Warning -Message 'Script warning message';

Rule 'WithError' {
    Write-Error -Message 'Rule error message';
    $True;
}

Rule 'WithWarning' {
    Write-Warning -Message 'Rule warning message';
    $True;
}

Rule 'WithVerbose' {
    Write-Verbose -Message 'Rule verbose message';
    $True;
}

Rule 'WithInformation' {
    Write-Information -MessageData 'Rule information message';
    $True;
}
Invoke-PSRule -Verbose -InformationAction Continue;

Expected behaviour

Verbose, information, warning and error messages should be returned to the host PowerShell runspace where they can interpreted or saved.

Module in use and version:

  • Module: PSRule
  • Version: 0.1.0
@BernieWhite BernieWhite added the bug Something isn't working label Dec 28, 2018
@BernieWhite BernieWhite added this to the v0.2.0 milestone Dec 28, 2018
@BernieWhite BernieWhite self-assigned this Dec 28, 2018
BernieWhite added a commit that referenced this issue Jan 3, 2019
BernieWhite added a commit that referenced this issue Jan 3, 2019
- Fix propagation of informational messages to host from rule scripts and definitions #48
- Add support for cross-platform environments (Windows, Linux, and macOS) #49
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