ansible/test/integration/targets/win_reboot/templates/post_reboot.ps1
Jordan Borean 940d4a0e89
win_reboot: fix 2.6 issues and better handle post reboot reboot (#42330)
* win_reboot: fix 2.6 issues and better handle post reboot reboot

* changed winrm _reset to reset

* Add handler to reset calls when .reset() throws an AnsibleError on older hosts

* Moving back to _reset to get the issue fixed
2018-07-11 09:12:29 +10:00

8 lines
328 B
PowerShell

if (Test-Path -Path '{{win_output_dir}}\win_reboot_test') {
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager' `
-Name PendingFileRenameOperations `
-Value @("\??\{{win_output_dir}}\win_reboot_test`0") `
-PropertyType MultiString
Restart-Computer -Force
exit 1
}