-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Add test for scriptblock logging for macOS #7586
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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!" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed #7589
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I also submitted #7588 to fix the issue with window VSTS |
PR Summary
Add test for scriptblock logging
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
to the beginning of the title and remove the prefix when the PR is ready.[feature]
if the change is significant or affects feature tests