powershell - 如何使用 Azure DevOps 在远程 Windows 机器上运行批处理文件,在目标机器上运行 Powershell?
问题描述
我想通过 Azure 管道在 Azure VM 上远程运行一些 PowerShell 命令。在我的虚拟机上,WinRM 配置了自签名证书,并且在 VM 防火墙上打开了端口 5986。在 VM 中,我可以通过 Test_setup_unattended.bat 执行 PowerShell 脚本并安装应用程序。但是,当我使用 AZDO 发布管道在目标机器上通过 Powershell 脚本运行相同的脚本时,目标机器上没有任何反应。有人可以帮我吗?
这是我使用 PowerShell 在 VM 中运行的脚本:
$fol = "C:\Program Files\Test"
Set-Location $fol
Start-Process Test_setup_unattended.bat -Wait
解决方案
推荐阅读
- c# - 为什么异步方法不能有 ref 或 out 参数?
- autodesk-forge - Dashboard.js Autodesk Forge
- java - 从 Eclipse 代码覆盖范围中排除特定文件/包
- nested - 具有嵌套因子的线性混合效应模型(完全嵌套设计)
- azure - Get-AzVM 在 Azure 上返回空列表
- lucene.net - Lucene.net 可以从压缩目录中搜索吗
- angular - angular11 mat-datetimepicker with moment-datetimer-adapter 不使用时间戳
- ios - 重新获取苹果凭据(Apple 使用 Expo 登录)
- python - Python,使用超过 20 次 mock.patch.object() 和太多静态嵌套块错误
- python - bash:/home/khawar/.local/bin/pip3:/home/khawar/anaconda3/envs/AAAIFace/bin/python:错误的解释器:没有这样的文件或目录