Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/wiki/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down