Hope this isn't a double post. Not sure if I understood your question. Howerver, I ran your method and it ran clean with no errors. Here is another way.
$srv='127.0.0.1'
$PingResults=Get-WmiObject win32_pingstatus -f "address='$srv'"
$PingResults
"Ping Status Completion Code "+$PingResults.StatusCode | out-host
$srv='BogusAddress.MyDomain.Com'
$PingResults=Get-WmiObject win32_pingstatus -f "address='$srv'"
$PingResults
"Ping Status Completion Code "+$PingResults.StatusCode | out-host
The second to BogusAddress.MyDomain.Com ping actually produces an erorr for me.