|
68 | 68 | "restart_timeout": "1h", |
69 | 69 | "check_registry": true |
70 | 70 | }, |
71 | | - <% if install_windows_updates %> |
72 | | - { |
73 | | - "type": "powershell", |
74 | | - "inline": [ |
75 | | - "$ErrorActionPreference = \"Stop\";", |
76 | | - "trap { $host.SetShouldExit(1) }", |
77 | | - "Add-Account -User Provisioner -Password <%= password %>" |
78 | | - ] |
79 | | - }, |
80 | | - { |
81 | | - "type": "powershell", |
82 | | - "inline": [ |
83 | | - "$ErrorActionPreference = \"Stop\";", |
84 | | - "trap { $host.SetShouldExit(1) }", |
85 | | - "Register-WindowsUpdatesTask" |
86 | | - ] |
87 | | - }, |
88 | | - { |
89 | | - "type": "powershell", |
90 | | - "inline": [ |
91 | | - "$ErrorActionPreference = \"Stop\";", |
92 | | - "trap { $host.SetShouldExit(1) }", |
93 | | - "Wait-WindowsUpdates -Password <%= password %> -User Provisioner" |
94 | | - ] |
95 | | - }, |
96 | | - { |
97 | | - "type": "windows-restart", |
98 | | - "restart_timeout": "12h", |
99 | | - "check_registry": true |
100 | | - }, |
101 | | - { |
102 | | - "type": "powershell", |
103 | | - "inline": [ |
104 | | - "$ErrorActionPreference = \"Stop\";", |
105 | | - "trap { $host.SetShouldExit(1) }", |
106 | | - "Unregister-WindowsUpdatesTask" |
107 | | - ] |
108 | | - }, |
109 | | - { |
110 | | - "type": "powershell", |
111 | | - "inline": [ |
112 | | - "$ErrorActionPreference = \"Stop\";", |
113 | | - "trap { $host.SetShouldExit(1) }", |
114 | | - "Get-HotFix > hotfixes.log" |
115 | | - ] |
116 | | - }, |
117 | | - { |
118 | | - "type": "file", |
119 | | - "source": "hotfixes.log", |
120 | | - "destination": "hotfixes.log", |
121 | | - "direction": "download" |
122 | | - }, |
123 | | - { |
124 | | - "type": "powershell", |
125 | | - "inline": [ |
126 | | - "$ErrorActionPreference = \"Stop\";", |
127 | | - "trap { $host.SetShouldExit(1) }", |
128 | | - "Remove-Account -User Provisioner" |
129 | | - ] |
130 | | - }, |
131 | | - <% end %> |
132 | 71 | { |
133 | 72 | "type": "powershell", |
134 | 73 | "inline": [ |
|
142 | 81 | "inline": [ |
143 | 82 | "$ErrorActionPreference = \"Stop\";", |
144 | 83 | "trap { $host.SetShouldExit(1) }", |
145 | | - "Install-SSHD" |
| 84 | + "Register-ScheduledTask -TaskName \"Install: OpenSSH.Server\" -Trigger (New-ScheduledTaskTrigger -Once -At ((Get-date) + (New-TimeSpan -Seconds 15))) -Principal (New-ScheduledTaskPrincipal -GroupId \"BUILTIN\\Administrators\" -RunLevel Highest) -Action (New-ScheduledTaskAction -Execute \"powershell.exe\" -Argument \"-Command `\"Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0`\"\") -Force" |
146 | 85 | ] |
147 | 86 | }, |
148 | 87 | { |
|
0 commit comments