Knowing status of a URL using PowerShell

Using following PowerShell script to check status of a URL. <URL> is the placeholder for the URL (for example '')
$ErrorActionPreference = 'SilentlyContinue'

# First we create the request.
$HTTP_Request = [System.Net.WebRequest]::Create('<URL>')

# We then get a response from the site.
$HTTP_Response = $HTTP_Request.GetResponse()

# We then get the HTTP code as an integer.
$HTTP_Status = [int]$HTTP_Response.StatusCode

If ($HTTP_Status -eq 200) {
Write-Host "Site is OK!"
Else {
Write-Host "The Site may be down, please check!"

'Site is OK!' message is returned if site returns status code 200 else  'The Site may be down, please check' message is shown.
UPDATED:  May 27, 2019