Skip to content

Commit 5d20e0d

Browse files
author
Rajath Agasthya
committed
Try ec2launchv2
1 parent 597a1ed commit 5d20e0d

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

modules/BOSH.Sysprep/BOSH.Sysprep.psm1

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,18 @@ function Remove-UserAccounts {
341341
$content.Save($AnswerFilePath)
342342
}
343343

344-
function Update-AWS2016Config
345-
{
346-
$LaunchConfigJson = 'C:\ProgramData\Amazon\EC2-Windows\Launch\Config\LaunchConfig.json'
347-
$LaunchConfig = Get-Content $LaunchConfigJson -raw | ConvertFrom-Json
348-
$LaunchConfig.addDnsSuffixList = $False
349-
$LaunchConfig.extendBootVolumeSize = $False
350-
$LaunchConfig | ConvertTo-Json | Set-Content $LaunchConfigJson
351-
}
344+
#function Update-AWS2016Config
345+
#{
346+
# $LaunchConfigJson = 'C:\ProgramData\Amazon\EC2-Windows\Launch\Config\LaunchConfig.json'
347+
# $LaunchConfig = Get-Content $LaunchConfigJson -raw | ConvertFrom-Json
348+
# $LaunchConfig.addDnsSuffixList = $False
349+
# $LaunchConfig.extendBootVolumeSize = $False
350+
# $LaunchConfig | ConvertTo-Json | Set-Content $LaunchConfigJson
351+
#}
352352

353353
function Create-Unattend-AWS
354354
{
355-
$UnattendedXmlPath = 'C:\ProgramData\Amazon\EC2-Windows\Launch\Sysprep\Unattend.xml'
355+
$UnattendedXmlPath = 'C:\ProgramData\Amazon\EC2Launch\sysprep\unattend.xml'
356356
$UnattendedContent = [xml](Get-Content $UnattendedXmlPath)
357357
$SpecializeSettings = ($UnattendedContent.unattend.settings | Where-Object { $_.pass -EQ "specialize" })
358358
$WindowsDeploymentComponent = ($SpecializeSettings.component | Where-Object { $_.name -EQ "Microsoft-Windows-Deployment" })
@@ -374,9 +374,8 @@ function Create-Unattend-AWS
374374

375375
function Enable-AWS2016Sysprep {
376376
# Enable sysprep
377-
cd 'C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts'
378-
./InitializeInstance.ps1 -Schedule
379-
./SysprepInstance.ps1
377+
cd 'C:\ProgramData\Amazon\EC2Launch\service'
378+
./EC2LaunchService.exe
380379
}
381380

382381
<#
@@ -430,7 +429,7 @@ function Invoke-Sysprep()
430429
"aws" {
431430
Disable-AgentService
432431
Create-Unattend-AWS
433-
Update-AWS2016Config
432+
# Update-AWS2016Config
434433
Enable-AWS2016Sysprep
435434
}
436435
"gcp" {

0 commit comments

Comments
 (0)