Вопрос

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.

Это было полезно?

Решение

Try with address in single quotes

powershell.exe [System.Net.Dns]::GetHostEntry('192.168.1.100')
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top