generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #679 from ministryofjustice/DSO/DSOS-2550/fix-serv…
…er-2022-ami-psreadline Dso/dsos 2550/fix server 2022 ami psreadline
- Loading branch information
Showing
4 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
name: psreadline_fix | ||
description: Component to fix PSReadline not rendering shell in things like Fleet Manager sessions on Windows Server 2022 | ||
schemaVersion: 1.0 | ||
parameters: | ||
- Version: | ||
type: string | ||
default: 0.0.4 | ||
description: Component version (update this each time the file changes) | ||
- Platform: | ||
type: string | ||
default: "Windows" | ||
description: Platform. | ||
phases: | ||
- name: build | ||
steps: | ||
- name: RunPSReadLineModuleInstallForceCommand | ||
action: ExecutePowerShell | ||
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 | ||
$psreadlineModuleDirectories = Get-ChildItem -Path "C:\Program Files\WindowsPowerShell\Modules\PSReadline" -Directory | ||
foreach ($psreadlineModuleDirectory in $psreadlineModuleDirectories) { | ||
$moduleDirectoryPath = $psreadlineModuleDirectory.FullName | ||
$moduleDirectoryName = $psreadlineModuleDirectory.Name | ||
if ($moduleDirectoryName -le "2.2.2") { | ||
Remove-Item -Recurse -Force -Path $moduleDirectoryPath | ||
} | ||
} | ||
$PSReadlineVersion = (Get-Module -ListAvailable PSReadLine).Version | ||
Write-Host "PSReadline Module Version: $PSReadlineVersion" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters