fix(pwsh): restore pwsh 5 support

In PowerShell 6+, the default encoding is UTF-8 without BOM on all
platforms.
In Windows PowerShell, the default encoding is usually Windows-1252,
an extension of latin-1, also known as ISO 8859-1.
This commit is contained in:
lnu 2021-11-30 06:21:06 +01:00 committed by Jan De Dobbeleer
parent e526491ae5
commit 82cad90aa0
2 changed files with 2 additions and 2 deletions

View file

@ -21,7 +21,7 @@
# Description of the functionality provided by this module # Description of the functionality provided by this module
Description = 'A prompt theme engine for any shell' Description = 'A prompt theme engine for any shell'
# Minimum version of the Windows PowerShell engine required by this module # Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '6.0' PowerShellVersion = '5.0'
# List of all files packaged with this module # List of all files packaged with this module
FileList = @() FileList = @()
# Cmdlets to export from this module # Cmdlets to export from this module

View file

@ -80,7 +80,7 @@ function Sync-PoshThemes {
) )
Write-Host "Downloading oh-my-posh themes for $Version" Write-Host "Downloading oh-my-posh themes for $Version"
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'zip' } PassThru $tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'zip' } -PassThru
$themesUrl = "https://github.com/jandedobbeleer/oh-my-posh/releases/download/v$Version/themes.zip" $themesUrl = "https://github.com/jandedobbeleer/oh-my-posh/releases/download/v$Version/themes.zip"
Invoke-WebRequest -OutFile $tmp $themesUrl Invoke-WebRequest -OutFile $tmp $themesUrl
$destination = $env:POSH_THEMES_PATH $destination = $env:POSH_THEMES_PATH