简体   繁体   中英

How to run powershell CheckNetIsolation command in batch file

I need to run the following Powershell command as mentioned in https://docs.microsoft.com/en-us/office/troubleshoot/error-messages/cannot-open-add-in-from-localhost from the command line:

CheckNetIsolation LoopbackExempt -a -n="microsoft.win32webviewhost_cw5n1h2txyewy"

Although it works on the PowerShell, it doesn't on the commandline. This is a command I tried:

powershell.exe -command "& {CheckNetIsolation LoopbackExempt -a -n=microsoft.win32webviewhost_cw5n1h2txyewy}"

Can anyone help?

The powershell command mentioned in the link is not a powershell specific command. It can be run as it is on the regular DOS commandline as long as DOS box was run as administrator.

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