How to send variables/arguments in powershell script?

working with variables:

Script using the variables:

try
{
  $status = wget $url | % {$_.StatusCode.ToString()}
}
catch [exception]
{
   $status = $_.Exception.Message.ToString()
}