|
42 | 42 | "New-Provisioner" |
43 | 43 | ] |
44 | 44 | }, |
45 | | - { |
46 | | - "type": "powershell", |
47 | | - "inline": [ |
48 | | - "$ErrorActionPreference = \"Stop\";", |
49 | | - "trap { $host.SetShouldExit(1) }", |
50 | | - "Remove-DockerPackage" |
51 | | - ] |
52 | | - }, |
53 | | - { |
54 | | - "type": "windows-restart", |
55 | | - "restart_timeout": "1h", |
56 | | - "check_registry": true |
57 | | - }, |
58 | | - { |
59 | | - "type": "powershell", |
60 | | - "inline": [ |
61 | | - "$ErrorActionPreference = \"Stop\";", |
62 | | - "trap { $host.SetShouldExit(1) }", |
63 | | - "Install-CFFeatures -IaaS <%= iaas %>" |
64 | | - ] |
65 | | - }, |
66 | | - { |
67 | | - "type": "windows-restart", |
68 | | - "restart_timeout": "1h", |
69 | | - "check_registry": true |
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 | 45 | { |
133 | 46 | "type": "powershell", |
134 | 47 | "inline": [ |
|
142 | 55 | "inline": [ |
143 | 56 | "$ErrorActionPreference = \"Stop\";", |
144 | 57 | "trap { $host.SetShouldExit(1) }", |
145 | | - "Install-SSHD" |
| 58 | + "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 | 59 | ] |
147 | 60 | }, |
148 | 61 | { |
|
0 commit comments