Question

This works perfect in CMD:

C:\>powershell.exe write-host -Foreground Red "hello"

But I have problem running this command:

C:\>powershell.exe [System.Net.Dns]::GetHostEntry("192.168.1.100")

I've already tried adding the -command options but still getting an error. Thanks in advance.

Was it helpful?

Solution

Try with address in single quotes

powershell.exe [System.Net.Dns]::GetHostEntry('192.168.1.100')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top