mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Improve coverage for Write-Information output
This commit is contained in:
committed by
Dongbo Wang
parent
0d3021c5ca
commit
ca2dce3537
@@ -75,6 +75,18 @@ Describe "Stream writer tests" -Tags "CI" {
|
||||
$result = Write-Information "Test Message" *>&1
|
||||
$result.GetType().Fullname | Should be "System.Management.Automation.InformationRecord"
|
||||
$result.NativeThreadId | Should Not Be 0
|
||||
$result.ProcessId | Should Be $pid
|
||||
if ($IsWindows)
|
||||
{
|
||||
# Use Match instead of Be so we can avoid dealing with a potential domain name
|
||||
$result.Computer | Should Match ".*${env:COMPUTERNAME}"
|
||||
$result.User | Should Match ".*${env:USERNAME}"
|
||||
}
|
||||
else
|
||||
{
|
||||
$result.Computer | Should Be $(uname -n)
|
||||
$result.User | Should Be $(whoami)
|
||||
}
|
||||
"$result" | Should be "Test Message"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user