powershell - NSIS 调用 powershell cmdlet Update-MpSignature 未被识别为 cmdlet powershell 的名称
问题描述
我使用 NSIS 调用 powershell 更新 windows 防御者定义,但是当我使用 nsExec::ExecToStack '"powershell.exe" -c Update-MpSignature'时,它报告错误“ Update-MpSignature is not known as the name of a cmdlet powershell” . 我试过在cmd中调用“powershell.exe”-c Update-MpSignature,效果很好。我也试过 NSIS 官方的 psexec.nsh ${PowerShellExecFileLog} call Update-MpSignature in ps1 file , 其他的 cmdlet 比如 Get-ChildItem、Remove-Item 都可以很好的工作,但是还是报错“ Update-MpSignature is not Recognized as the cmdlet powershell 的名称。有人可以帮我吗?
解决方案
这听起来像是一个 64 位的问题。
在 64 位系统上,您可以尝试$WINDIR\sysnative\windowspowershell\v1.0\powershell.exe
像此头文件一样执行。
推荐阅读
- excel - 使用数组读取/写入表
- java - 与 Java 正则表达式不匹配
- python - 如果选择运行所有测试,PyTest 记录器不显示任何输出
- python - CatBoostRegressor 在尝试预测时显示错误(TypeError: Cannot convert 'b' to float)
- duplicates - 使用 apache_nifi 删除从数据库移动到 hdfs 的重复文件
- python - 如何在 keras 中使用 ImageDataGenerator 和 flow_from_directory 保存增强图像
- javascript - 如何在 React Native 中垂直渲染数据?
- javascript - MoveItem 无效请求
- python-3.x - 将条目(Active Directory 用户)和按钮(搜索)Python TKInter 小部件绑定到 Powershell 获取要在 TkInter 文本框中显示的用户命令
- php - PHP 无法加载 imagick 扩展(Windows)