From 494b72e6808bdf55e97de1fccb59b0c519ea7c83 Mon Sep 17 00:00:00 2001 From: jerryabo <94194023+jerryabo@users.noreply.github.com> Date: Thu, 10 Mar 2022 11:15:51 -0600 Subject: [PATCH] Add to text logging for easier diagnosability This will allow control-f'ers to more easily find the error, and some log parsers to automatically highlight the error(s), for easier discoverability. --- Test-IntuneFirewallRules.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test-IntuneFirewallRules.ps1 b/Test-IntuneFirewallRules.ps1 index 25c9f8e..8942cc6 100644 --- a/Test-IntuneFirewallRules.ps1 +++ b/Test-IntuneFirewallRules.ps1 @@ -958,7 +958,7 @@ NAME: Test-FirewallRuleCreatesSuccessfully } catch { [string]$Remediation = "" $errMsg = $error[0] - "`r`n$tabs$stars`r`n`r`n$tabs Exception creating rule. Name: $dispName`: $errMsg`r`n`r`n$tabs$stars`r`n" | Write-Log -WriteStdOut + "`r`n$tabs$stars`r`n`r`n$tabs Error: Exception creating rule. Name: $dispName`: $errMsg`r`n`r`n$tabs$stars`r`n" | Write-Log -WriteStdOut $Remediation = Get-SuggestedAction -ExceptionInfo $errMsg -DetectedPathIssues $DetectedPathIssues -FilePath $ConstructedCommandLineArgs.program ` -Port ( ($ConstructedCommandLineArgs.localPort) + ($ConstructedCommandLineArgs.RemotePort)) -Protocol $ConstructedCommandLineArgs.protocol Write-BadRule -FWRule $FWRuleToCreate -ExceptionInfo $errMsg -DetectedPathIssues $DetectedPathIssues -PolicyName $PolicyName -SuggestedFix $Remediation