Skip to content

Commit 26dcceb

Browse files
committed
Update message in Test case for WriteHost Rule
1 parent 06d4972 commit 26dcceb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tests/Rules/AvoidUsingWriteHost.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Import-Module PSScriptAnalyzer
22
Set-Alias ctss ConvertTo-SecureString
3-
$writeHostMessage = [Regex]::Escape("File 'AvoidUsingWriteHost.ps1' uses Write-Host. This is not recommended because it may not work in some hosts or there may even be no hosts at all. Use Write-Output instead.")
3+
$writeHostMessage = [Regex]::Escape("File 'AvoidUsingWriteHost.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.")
44
$writeHostName = "PSAvoidUsingWriteHost"
55
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
66
$violations = Invoke-ScriptAnalyzer $directory\AvoidUsingWriteHost.ps1 | Where-Object {$_.RuleName -eq $writeHostName}

0 commit comments

Comments
 (0)