fix(windows): make powershell init work on windows 8 again (#3067)
This commit is contained in:
parent
b22c54fccc
commit
ab25bc82c5
|
@ -24,12 +24,13 @@ function global:prompt {
|
||||||
|
|
||||||
function Invoke-Native {
|
function Invoke-Native {
|
||||||
param($Executable, $Arguments)
|
param($Executable, $Arguments)
|
||||||
$startInfo = [System.Diagnostics.ProcessStartInfo]::new($Executable);
|
$startInfo = New-Object System.Diagnostics.ProcessStartInfo -ArgumentList $Executable -Property @{
|
||||||
$startInfo.StandardOutputEncoding = [System.Text.Encoding]::UTF8;
|
StandardOutputEncoding = [System.Text.Encoding]::UTF8;
|
||||||
$startInfo.RedirectStandardOutput = $true;
|
RedirectStandardOutput = $true;
|
||||||
$startInfo.RedirectStandardError = $true;
|
RedirectStandardError = $true;
|
||||||
$startInfo.CreateNoWindow = $true;
|
CreateNoWindow = $true;
|
||||||
$startInfo.UseShellExecute = $false;
|
UseShellExecute = $false;
|
||||||
|
};
|
||||||
if ($startInfo.ArgumentList.Add) {
|
if ($startInfo.ArgumentList.Add) {
|
||||||
# PowerShell 6+ uses .NET 5+ and supports the ArgumentList property
|
# PowerShell 6+ uses .NET 5+ and supports the ArgumentList property
|
||||||
# which bypasses the need for manually escaping the argument list into
|
# which bypasses the need for manually escaping the argument list into
|
||||||
|
|
Loading…
Reference in New Issue