سؤال

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