0

I have a simple script to test the blocking of palo test sites. How to suppress the bytes read message and have a clean output?

$palotestsites = @("http://urlfiltering.paloaltonetworks.com/test-web-based-email",
    "http://urlfiltering.paloaltonetworks.com/test-cryptocurrency",
    "http://urlfiltering.paloaltonetworks.com/test-grayware")
foreach ($t in $palotestsites)
{
    try
    {
        $response = Invoke-WebRequest $t -MaximumRedirection 1
        Write-Host "  "  $response.statuscode " " $t -ForegroundColor Green
        
    }
    catch
    {
        Write-Host "  " $_.Exception.Response.StatusCode.Value__ " " $t -ForegroundColor Red
    }
}

enter image description here

Zippy
  • 455
  • 1
  • 11
  • 25

1 Answers1

0
$ProgressPreference = 'SilentlyContinue'    # Subsequent calls do not display UI.

https://stackoverflow.com/a/18770794

dosentmatter
  • 1,494
  • 1
  • 16
  • 23