首页 > 解决方案 > 在powershell文件中调用EXE文件

问题描述

我尝试了以下方法:

Start-Process "C:\Tool\alert.exe" -WindowStyle Hidden

当尝试在 powershell ise 中运行此 ps1 文件时,我收到以下弹出消息。

The Publisher could not be verified. Are you sure you want to run this software

我的问题是:如何摆脱“无法验证发布者。您确定要运行此软件”吗?

标签: powershell

解决方案


这是由于 Windows 中将 .exe 文件标记为“高风险”的设置。您可以Unblock-File在运行可执行文件之前使用该命令取消阻止它们。

Get-ChildItem "C:\Tool\alert.exe" | Unblock-File

你可以在这里阅读更多信息:https ://winaero.com/blog/how-to-unblock-files-downloaded-from-internet-in-windows-10/


推荐阅读