diff --git a/commonimages/components/templates/psreadline_fix.yml b/commonimages/components/templates/psreadline_fix.yml index 1b3642e26..0380eee39 100644 --- a/commonimages/components/templates/psreadline_fix.yml +++ b/commonimages/components/templates/psreadline_fix.yml @@ -5,7 +5,7 @@ schemaVersion: 1.0 parameters: - Version: type: string - default: 0.0.2 + default: 0.0.3 description: Component version (update this each time the file changes) - Platform: type: string @@ -19,4 +19,23 @@ phases: inputs: commands: - | + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force + Install-Module -Name PSReadLine -Repository PSGallery -MinimumVersion 2.2.2 -Force -AllowClobber -Confirm:$false + + # delete old versions of Windows PowerShell PSReadline which are the issue + + $moduleDirectories = Get-ChildItem -Path "C:\Program Files\WindowsPowerShell\Modules\PSReadline" -Directory -Depth 0 + + foreach ($psreadlineModuleDirectory in $psreadlineModuleDirectories) { + $moduleDirectoryPath = $psreadlineModuleDirectory.FullName + $moduleDirectoryName = $psresdlineModuleDirectory.Name + + if ($moduleDirectoryName -le "2.2.2") { + Remove-Item -Recurse -Force -Path $moduleDirectoryPath + } + } + + $PSReadlineVersion = (Get-Module -ListAvailable PSReadLine).Version.ToString() + + Write-Host "PSReadline Module Version: $PSReadlineVersion" diff --git a/teams/hmpps/windows_server_2022/locals.tf b/teams/hmpps/windows_server_2022/locals.tf index 92cb295ba..9bede5b99 100644 --- a/teams/hmpps/windows_server_2022/locals.tf +++ b/teams/hmpps/windows_server_2022/locals.tf @@ -12,7 +12,7 @@ locals { }, { name = "psreadline_fix" - version = "0.0.2" + version = "0.0.3" parameters = [] } ] diff --git a/teams/hmpps/windows_server_2022/terraform.tfvars b/teams/hmpps/windows_server_2022/terraform.tfvars index c4be65390..2d7e80ca0 100644 --- a/teams/hmpps/windows_server_2022/terraform.tfvars +++ b/teams/hmpps/windows_server_2022/terraform.tfvars @@ -5,7 +5,7 @@ region = "eu-west-2" ami_name_prefix = "hmpps" ami_base_name = "windows_server_2022" -configuration_version = "0.1.1" +configuration_version = "0.1.2" release_or_patch = "release" # or "patch", see nomis AMI image building strategy doc description = "windows server 2022"