powershell - 在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
我的问题是:如何摆脱“无法验证发布者。您确定要运行此软件”吗?
解决方案
这是由于 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/
推荐阅读
- javascript - 我的 chartJS axios.get 被触发了两次,导致图表也渲染了两次,我不知道为什么。我正在使用 react-chartjs-2
- cvs2git - cvs2git 在将 CVS 迁移到 Git 时创建了一些额外的提交
- mongodb - 将 vert.x 异步 mongo 客户端与 spring data mongodb 一起使用
- ruby-on-rails - 如何记住复选框状态Rails?
- reactjs - SDK 32.0.0 不是有效的 SDK
- json - XSLT 将 JSON 转换为 XML 错误“序言中不允许内容”
- arrays - 一次将数组添加到 ArrayList
- docker - Docker compose 耗时过长
- sql-server - 使用 Azure SQL 数据库设计全球可用的服务
- java - 为什么 Maven 编译/运行错误的代码?