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

Add test for scriptblock logging for macOS #7586

Merged
merged 2 commits into from
Aug 21, 2018

Conversation

TravisEz13
Copy link
Member

@TravisEz13 TravisEz13 commented Aug 21, 2018

PR Summary

Add test for scriptblock logging

PR Checklist

@TravisEz13 TravisEz13 changed the title Add test for scriptblock logging Add test for scriptblock logging for macOS Aug 21, 2018
Copy link
Contributor

@dantraMSFT dantraMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor comments; otherwise LGTM.


if($item.LogId -notmatch '^\[com\.microsoft\.powershell')
{
Write-Verbose "logId: $($item.LogId)" -Verbose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest changing the verbose message slightly, to something like:

"Skipping logId: $($item.LogId)"

}
else
{
[string] $filter = [string]::Format("com.microsoft.powershell.{0}: (", $id)
Get-Content @contentParms -filter {$_.Contains($filter)} | ConvertFrom-OsLog -Id $Id -After $After | Select-Object -First $maxItems
Write-Warning "this code path `Get-PSOsLog -TotalCount` should not be used if the message field is needed!"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest filing an issue against this. The intent is for the entire log entry to be returned even when using TotalCount.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed #7589

Copy link
Contributor

@anmenaga anmenaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TravisEz13
Copy link
Member Author

I also submitted #7588 to fix the issue with window VSTS

@TravisEz13 TravisEz13 merged commit 849f6fb into PowerShell:master Aug 21, 2018
@TravisEz13 TravisEz13 deleted the Add_ScriptBlockLogging_Tests branch August 21, 2018 20:21
@TravisEz13 TravisEz13 added this to the v6.1.0 milestone Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants