fix(pwsh): stop paths from being interpreted as patterns (#1569)

Convert-Path in the powershell prompt script works with -Path,
which interprets paths as wildcard patterns.  

Not all valid paths are also valid wildcard patterns, possibly causing
the prompt to error (eg []*).  

Replace it with -LiteralPath that makes Convert-Path use the path as-is.
This commit is contained in:
David Knaack 2020-08-20 06:45:10 +02:00 committed by GitHub
parent 09672eeea7
commit d4515696a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ function global:prompt {
$jobs = @(Get-Job | Where-Object { $_.State -eq 'Running' }).Count
$env:PWD = $PWD
$current_directory = (Convert-Path $PWD)
$current_directory = (Convert-Path -LiteralPath $PWD)
if ($lastCmd = Get-History -Count 1) {
$duration = [math]::Round(($lastCmd.EndExecutionTime - $lastCmd.StartExecutionTime).TotalMilliseconds)