diff --git a/.github/wiki/Getting-Started.md b/.github/wiki/Getting-Started.md index 6530463c4..91c3124b8 100644 --- a/.github/wiki/Getting-Started.md +++ b/.github/wiki/Getting-Started.md @@ -126,25 +126,21 @@ An adaptation of the above snippet suited for `Powershell`. Put this script in t ```pwsh # git repository greeter + +# Set the console output encoding to UTF-8, so that special characters are displayed correctly when piping to Write-Host +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $global:lastRepository = $null function Check-DirectoryForNewRepository { $currentRepository = git rev-parse --show-toplevel 2>$null if ($currentRepository -and ($currentRepository -ne $global:lastRepository)) { - onefetch + onefetch | Write-Host } $global:lastRepository = $currentRepository } function Set-Location { - param ( - [string]$path - ) - - # Use the default Set-Location to change the directory - Microsoft.PowerShell.Management\Set-Location -Path $path - - # Check if we are in a new Git repository + Microsoft.PowerShell.Management\Set-Location @args Check-DirectoryForNewRepository }