hashicorp / hashicorp/packer-plugin-amazon

Build.Password is not set when using SSH on windows

Open
#444 0 comments 1 reaction 0 assignees View on GitHub
bug sync to jira
Dominant language
Go
Stars
91
Forks
141
Avg merge
2d 18h
Merged PRs (30d)
3

Description

#### Overview of the Issue
When using the new SSH on Windows functionality, it doesn't appear to be setting build.Password (that is recommend [here](https://developer.hashicorp.com/packer/docs/provisioners/powershell#elevated_user)).

It seems to be the same issue as https://github.com/hashicorp/packer-plugin-azure/issues/267

#### Reproduction Steps
using this provisioner

```
provisioner "powershell" {
environment_vars = ["WINDOWSPASS=${build.Password}"]
scripts = [demo.ps1"]
}
```

with a demo.ps1
```
Write-Host "Windows Administrator password is: $Env:WINDOWSPASS"
```

##### Current output
```
Using SSH communicator to connect: x.x.x.x
Waiting for SSH to become available...
Connected to SSH!
Provisioning with Powershell...
Provisioning with powershell script: demo.ps1
Windows Administrator password is:
```

Windows password is empty!

### Plugin and Packer version

packer version: Packer v1.10.0
packer-plugin-amazon version: 1.2.8

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.