简体   繁体   English

如何在批处理文件中运行 powershell CheckNetIsolation 命令

[英]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:我需要从命令行运行https://docs.microsoft.com/en-us/office/troubleshoot/error-messages/cannot-open-add-in-from-localhost 中提到的以下 Powershell 命令:

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

Although it works on the PowerShell, it doesn't on the commandline.尽管它适用于 PowerShell,但它不适用于命令行。 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.链接中提到的 powershell 命令不是特定于 powershell 的命令。 It can be run as it is on the regular DOS commandline as long as DOS box was run as administrator.只要以管理员身份运行 DOS 框,它就可以像在常规 DOS 命令行上一样运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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