admin管理员组

文章数量:1287579

I'm trying to install a visual studio extension with ansible win_shell, and having some issues.

The GUI way to do it is to run the Developer Command Prompt for Visual Studio 2022 as Administrator, and then run VSIXInstaller.exe to install the extension. I can install the ext when I do this.

The catch is that Developer Command Prompt is just an alias to VsDevCmd.bat, which sets up the cmd environment. The shortcut in start menu points to:

%comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\VsDevCmd.bat"

I've tried running that command in win_shell, followed by the installcommand, with no luck.

I've tried adding executable: cmd to make win_shell run under cmd.

I've tried cloning VsDevCmd.bat and adding the VSIXInstaller.exe command right at the end of the script.

Nothing seems to be working for me. I suspect this is something related to the way ansible handles multiple commands in one block, and the way VsDevCmd.bat sets up the environment. Does anyone have ideas?

本文标签: Install Visual Studio 2022 extensions with ansible winshellStack Overflow