Test for Localhost in Powershell?
You could always query the local IP through WMI and store it in $localIP and then match that against whatever address is currently next in your pipeline or array:
if ($localIP -eq $otherIP) { get-wmiobject without -credential }
else { existing query }
If you wrap it in a try catch block with erroraction stop on the first command, it will trap the error and run the catch block without credentials.
Try
{
Get-WmiObject -Credential domain\user -ComputerName localhost -class Win32_BIOS -erroraction Stop
}
Catch
{
Get-WmiObject -ComputerName localhost -class Win32_BIOS
}