Can windows-shell access the WinRMPassword variable?

19 views
Skip to first unread message

goffries

unread,
Oct 9, 2018, 4:09:32 PM10/9/18
to Packer
Can the windows shell provisioner access the WinRMPassword variable like in the below example?

        {
            "type": "windows-shell",
            "environment_vars": ["WINRMPASS={{.WinRMPassword}}"],
            "inline": [
                "reg add \"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" /v AutoAdminLogon /t REG_SZ /d 1",
                "reg add \"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" /v DefaultUserName /t REG_SZ /d packer",
                "reg add \"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" /v DefaultPassword /t REG_SZ /d %WINRMPASS%"
            ]
        }

Each time i've tried i've only gotten this.

C:\Users\packer>reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d <no value>

Megan Marsh

unread,
Oct 9, 2018, 4:12:37 PM10/9/18
to packe...@googlegroups.com
It can't.  Can you make a feature request on github?

goffries

unread,
Oct 9, 2018, 4:13:03 PM10/9/18
to Packer
sure thing. thanks for the quick response.

Megan Marsh

unread,
Oct 9, 2018, 4:13:51 PM10/9/18
to packe...@googlegroups.com
No problem!  :)

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/9bae91e6-7b9b-400e-a873-cafa179a224f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages