I think the scheduled task is to work around an issue with Windows Update
API. You can't run it via WinRM you have to run it locally on the system.
Using the Task Scheduler works around this.

On Thu, Jun 15, 2017 at 4:18 AM Rickard von Essen <
[email protected]> wrote:

> > I don't understand why Packer is trying to use the Task Scheduler to run
> PowerShell scripts in the first place. Why doesn't it just upload the
> script and execute?
>
> To my understanding that is how you must do it to elevate privileges and
> run a script. If you have another way of doing it please enlightening us.
>
> On Jun 14, 2017 18:59, "Joshua H." <[email protected]> wrote:
>
> I too am getting the exact same error with Server 2012. I'm not sure
> exactly what the issue is, or how to work around it. This is with Packer
> 1.0.0.
>
> I don't understand why Packer is trying to use the Task Scheduler to run
> PowerShell scripts in the first place. Why doesn't it just upload the
> script and execute?
>
> The OP said not elevating the script seems to work, so I will give that a
> shot, but that shouldn't matter.
>
> --
> 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/9ebfe018-63ea-476a-968e-763b614b0020%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/9ebfe018-63ea-476a-968e-763b614b0020%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 a topic in the
> Google Groups "Packer" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/packer-tool/QKlsgxYqUSY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CALz9Rt-k%3DkBb6hwmTtgPQdfQ5k3Ln4zb6bXSL_vSNEDE4uAtTg%40mail.gmail.com
> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt-k%3DkBb6hwmTtgPQdfQ5k3Ln4zb6bXSL_vSNEDE4uAtTg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJuptT4utvmuZT7h9nGwPpbWV2s4GjXjOMuCsngyFt4gpB6Gbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to