Skip to content

Instantly share code, notes, and snippets.

@shazron
Last active June 24, 2024 14:36
Show Gist options
  • Save shazron/3c288c2a5c538725ee114449e9871dfb to your computer and use it in GitHub Desktop.
Save shazron/3c288c2a5c538725ee114449e9871dfb to your computer and use it in GitHub Desktop.
Powershell, launch fork.exe with a directory path
# From https://github.com/fork-dev/TrackerWin/issues/416#issuecomment-1246248261
#
# Launch fork.exe from the command line with a directory path argument.
#
# App: https://git-fork.com/
# Usage: fork <directory_path>
#
# Load your profile in Notepad:
# notepad $PROFILE
# Then, add the contents below:
if ($env:OS -match 'Windows_NT') {
function Invoke-Fork {
param($Path)
$forkExe = "$env:LOCALAPPDATA\Fork\Fork.exe"
if (-not $Path) {
& $forkExe
}
else {
$absolutePath = Resolve-Path $Path
& $forkExe $absolutePath
}
}
Set-Alias fork Invoke-Fork
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment