This cmdlet is part of the Vexasoft Cmdlet Library. You can download it now or click here to find out more.

Ping-WebPage

Synopsis

Verifies that a webpage is available and, optionally, whether it contains certain text.

Syntax

  • Ping-WebPage [-URL] [-ContainsText]

Description

Ping-WebPage is used to verify the status of a webpage and can also be used to verify webpage content using the ContainsText parameter.

Parameters

  • URL The web page URL to test.
  • ContainsText Text to check for in addition to verifying that the page is live.

Inputs

Ping-WebPage accepts pipeline input for the URL parameter.

Outputs

Test-WebLink outputs a Vexasoft.WebPageStatus object detailing the status of the URL tested.

Notes

There are no notes associated with this cmdlet.

Example 1

This command will report the status of the mycompany.com homepage:

c:\PS>Ping-WebPage www.mycompany.com

Example 2

This command will report the status of web page www.mywebsite.com/links/ and whether it is also serving the text "My Critical Content".

c:\PS>Ping-WebPage www.mywebsite.com/links -ContainsText "My Critical Content"

Example 3

Ping-WebPage accepts web addresses as input. This command will check the status of each web page in the $MyURLs variable.

c:\PS>$MyURLs | Ping-WebPage