diff --git a/CHANGELOG.md b/CHANGELOG.md index 652583e2d..3395b55cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ BUG FIXES: in ".1" [GH-6150] - commands/up: the `--provision-with` flag works with provisioner names [GH-5981] - communicator/winrm: respect `boot_timeout` setting [GH-6229] + - communicator/winrm: execute scheduled tasks immediately on Windows XP + since elevation isn't required [GH-6195] - guests/debian: graceful shutdown works properly with newer releases [GH-5986] - guests/suse: DHCP network interfaces properly configured [GH-6502] - provisioners/ansible: use quotes for the `ansible_ssh_private_key_file` diff --git a/plugins/communicators/winrm/scripts/elevated_shell.ps1.erb b/plugins/communicators/winrm/scripts/elevated_shell.ps1.erb index 5cdd58bda..a33644bd8 100644 --- a/plugins/communicators/winrm/scripts/elevated_shell.ps1.erb +++ b/plugins/communicators/winrm/scripts/elevated_shell.ps1.erb @@ -1,5 +1,8 @@ param([String]$username, [String]$password, [String]$encoded_command) +# Try to get the Schedule.Service object. If it fails, we are probably +# on an older version of Windows. On old versions, we can just execute +# directly since priv. escalation isn't a thing. $schedule = $null Try { $schedule = New-Object -ComObject "Schedule.Service"