@@ -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
353353function 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
375375function 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