Hi, Tim. The simplest way is probably to test the credentials using Connect-NaController:
Connect-NaController 10.61.167.60 -Credential root -ErrorAction Stop -Transient
If an error occurs, the script will abort.
If you want more control over the error handling, something like this might work:
$c = Connect-NaController 10.61.167.60 -Credential root -ErrorAction SilentlyContinue -Transient
if ($c -EQ $null) { Write-Host "Connection failed." }