You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview of the Issue
Connecting to Windows over ssh leaving the default shell (cmd.exe) and attempting to run a Powershell script results in executing getting stuck.
It appears the default execute command is cutting off the Powershell arguments due to using an ampersand (&).
Reproduction Steps
Launch Packer on a AWS EBS target with OpenSSH setup by EC2Luanchv2 using the following UserData
version: 1.1tasks:
- task: enableOpenSsh
Execute the powershell providioner with a script file specified.
Execution hangs
I see sshd.exe has launched:
c:\windows\system32\cmd.exe /c powershell -executionpolicy bypass & { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. c:/Windows/Temp/packer-ps-env-vars-675b4cad-258a-9559-524d-13dd7c6a4d0b.ps1; &'c:/Windows/Temp/script-675b4cad-9a55-e618-7ab5-50c56aa62596.ps1'; exit $LastExitCode }
Which has launched
powershell -executionpolicy bypass
Include appropriate log fragments. If the log is longer than a few dozen lines,
please include the URL to the gist of the log or
use the Github detailed format instead of posting it directly in the issue.
Set the env var PACKER_LOG=1 for maximum log detail.
The text was updated successfully, but these errors were encountered:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview of the Issue
Connecting to Windows over ssh leaving the default shell (cmd.exe) and attempting to run a Powershell script results in executing getting stuck.
It appears the default execute command is cutting off the Powershell arguments due to using an ampersand (&).
Reproduction Steps
I see sshd.exe has launched:
c:\windows\system32\cmd.exe /c powershell -executionpolicy bypass & { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. c:/Windows/Temp/packer-ps-env-vars-675b4cad-258a-9559-524d-13dd7c6a4d0b.ps1; &'c:/Windows/Temp/script-675b4cad-9a55-e618-7ab5-50c56aa62596.ps1'; exit $LastExitCode }
Which has launched
powershell -executionpolicy bypass
Packer version
Packer v1.11.2
Simplified Packer Template
Operating system and Environment details
Windows 10 AMD64, building for Windows Server 2019 AMD64
Log Fragments and crash.log files
Include appropriate log fragments. If the log is longer than a few dozen lines,
please include the URL to the gist of the log or
use the Github detailed format instead of posting it directly in the issue.
Set the env var
PACKER_LOG=1
for maximum log detail.The text was updated successfully, but these errors were encountered: