Skip to content

Commit ad53c84

Browse files
committed
DEBUG: remove before merge
1 parent 6103454 commit ad53c84

File tree

2 files changed

+6
-88
lines changed

2 files changed

+6
-88
lines changed

lib/packer/config/templates/provision_windows2019.json.erb

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -42,93 +42,6 @@
4242
"New-Provisioner"
4343
]
4444
},
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 %>
13245
{
13346
"type": "powershell",
13447
"inline": [
@@ -142,7 +55,7 @@
14255
"inline": [
14356
"$ErrorActionPreference = \"Stop\";",
14457
"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"
14659
]
14760
},
14861
{

modules/BOSH.SSH/BOSH.SSH.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313

1414
foreach ($sshPackage in $sshPackages) {
1515
$packageResult = Get-WindowsCapability -Online -Name "$sshPackage*"
16+
Write-Host "Checking: $packageResult"
1617

1718
$packageState = ($packageResult | ForEach-Object State)
1819
if ($packageState -eq "NotPresent") {
1920
$packageSpecifier = ($packageResult | ForEach-Object Name)
21+
Write-Host "Building install task for: $packageSpecifier"
2022

2123
$runIn15Seconds = New-ScheduledTaskTrigger -Once -At ((Get-date) + (New-TimeSpan -Seconds 15))
2224
$runAsCurrentUserHighestPrivileges = New-ScheduledTaskPrincipal -GroupId "BUILTIN\Administrators" -RunLevel Highest
2325
$taskCommand = "-Command `"Add-WindowsCapability -Online -Name $packageSpecifier`""
26+
Write-Host "Task: -Argument '$taskCommand'"
2427

2528
Register-ScheduledTask `
2629
-TaskName "Install: '$packageSpecifier'" `
@@ -29,8 +32,10 @@
2932
-Principal $runAsCurrentUserHighestPrivileges `
3033
-Action (New-ScheduledTaskAction -Execute "powershell.exe" -Argument $taskCommand) `
3134
-Force
35+
Write-Host "Register-ScheduledTask: $_"
3236

3337
Start-Sleep -Seconds 120 # wait for install to trigger
38+
Write-Host "Finished sleeping after install task for: $packageSpecifier"
3439
}
3540
}
3641
}

0 commit comments

Comments
 (0)