Skip to content

Commit

Permalink
cope with old versions of psreadline module and missing installer
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsweetman committed Jan 23, 2024
1 parent 810636e commit d985f5f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
21 changes: 20 additions & 1 deletion commonimages/components/templates/psreadline_fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
2 changes: 1 addition & 1 deletion teams/hmpps/windows_server_2022/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ locals {
},
{
name = "psreadline_fix"
version = "0.0.2"
version = "0.0.3"
parameters = []
}
]
Expand Down
2 changes: 1 addition & 1 deletion teams/hmpps/windows_server_2022/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit d985f5f

Please sign in to comment.