简体   繁体   中英

How to run powershell command via cmd.

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.

尝试使用单引号中的地址

powershell.exe [System.Net.Dns]::GetHostEntry('192.168.1.100')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM