powershell - 当我尝试通过 TFS Build 运行时,Powershell 脚本未安装 exe
问题描述
我有一个将安装 exe 的 powershell 脚本。当我从 powershell ISE 控制台尝试它时它工作正常,但是当我从 TFS 构建步骤尝试它时它失败了。注意:我的 TFS 用户、代理用户和触发用户是相同的。任何人都可以对这个问题有所了解吗?
Start-Process -FilePath $installerFileName -Verb "runas" -ArgumentList $parameter -Wait
上面的代码是用来安装exe的。$parameter 是自定义参数的列表。
我得到以下错误
[WixSession.GetSession][GetSessionValues]异常:值不能为空。参数名称:s
解决方案
你想安装什么样的exe?是否支持静默安装?如果在安装过程中弹出 UI,则代理需要以交互模式运行。
使用以下命令在我这边测试以使用服务模式安装/卸载记事本++,一切都按预期工作:
start-process -FilePath "D:\Software\npp.7.5.8.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait
和:
start-process -FilePath "C:\Program Files\Notepad++\uninstall.exe" -ArgumentList '/S' -Verb runas -Wait
推荐阅读
- hyperledger-fabric - 如何将 Hyperledger farbic 2.0 链码从 shim 升级到合约 api
- node.js - Estack MEAN -> net::ERR_CONNECTION_REFUSED
- c++ - QT c++ 图表列表
- performance - 如何在 Jmeter 的线程组中循环采样器,直到返回特定的响应值
- swiftui - MacOS 上的 SwiftUI:单击 NavigationLink 时调用函数
- c++ - 具有异步采集的时间关键型 QT、UART、ISAAC 和 dll 的 C++ 处理策略
- r - 如何在 ggplot 中制作循环的、类似甜甜圈的颜色图例?
- html - 需要显示子菜单和隐藏菜单项
- python-3.x - Python将外部库消息记录到文件
- flutter - 修复 FutureBuilder 的问题