1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-05 12:57:50 +00:00

fix(windows): make powershell init work on windows 8 again (#3067)

This commit is contained in:
David Knaack 2021-09-25 21:07:23 +02:00 committed by GitHub
parent b22c54fccc
commit ab25bc82c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,12 +24,13 @@ function global:prompt {
function Invoke-Native {
param($Executable, $Arguments)
$startInfo = [System.Diagnostics.ProcessStartInfo]::new($Executable);
$startInfo.StandardOutputEncoding = [System.Text.Encoding]::UTF8;
$startInfo.RedirectStandardOutput = $true;
$startInfo.RedirectStandardError = $true;
$startInfo.CreateNoWindow = $true;
$startInfo.UseShellExecute = $false;
$startInfo = New-Object System.Diagnostics.ProcessStartInfo -ArgumentList $Executable -Property @{
StandardOutputEncoding = [System.Text.Encoding]::UTF8;
RedirectStandardOutput = $true;
RedirectStandardError = $true;
CreateNoWindow = $true;
UseShellExecute = $false;
};
if ($startInfo.ArgumentList.Add) {
# PowerShell 6+ uses .NET 5+ and supports the ArgumentList property
# which bypasses the need for manually escaping the argument list into