I can't share my entire json file , as it is part of my work and it may be 
a violation of rights. I am using this for restarting. Can you try this?
    {
     "type": "powershell",
     "execute_command": "powershell -executionpolicy bypass \"& { if 
(Test-Path 
variable:global:ProgressPreference){\\$ProgressPreference='SilentlyContinue'};. 
{{.Vars}}; &'{{.Path}}'; exit \\$LastExitCode }\"",
     "pause_before": "15m",
     "inline": [
       "echo \"Restart Computer\"; Start-Sleep 5; Restart-Computer -force"
     ]
   },



On Wednesday, May 29, 2019 at 9:26:56 PM UTC+5:30, Deval Ganatra wrote:
>
> Hi all,
> I am trying to create AMI for CIS benchmark hardening. Other things are 
> working fine except windows-restart provisioner. As restart is necessary in 
> windows to complete so many things, I am trying to restart instance before 
> creating AMI. Can anyone help me with that?
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/79f12020-3090-4dcd-838b-d08319c8f3fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to