1. Подставляет
2. Get-WmiObject -Class Win32_OperatingSystem -Namespace root/cimv2 -ComputerName $IP - должно быть,а не содежимое переменной
3. Если требуется исполнять код в catch, то добавить -ErrorAction Stop
Код:

For ($n=1; $n -le 254; $n++) {
$IP = "172.168.55.$n"
Try {
Write-Host "Connect to $IP" -ForeGround Yellow
Get-WmiObject -Class Win32_OperatingSystem -Namespace root/cimv2 -ComputerName $IP -ErrorAction Stop
}
Catch {
write-Output $_.Exception|format-list -force
}
}
И чтобы убедиться:
PS (STA) > Trace-Command {Get-WmiObject -Class Win32_OperatingSystem -Namespace root/cimv2 -ComputerName $IP} -PSHost -Name ParameterBinding
...........................................
DEBUG: ParameterBinding Information: 0 :
BIND arg [172.168.55.1] to parameter [ComputerName]