Skip to content

Instantly share code, notes, and snippets.

@ImIOImI
Last active July 15, 2020 02:20
Show Gist options
  • Save ImIOImI/5da3e82574fdb96f252d6eadf3cdce5a to your computer and use it in GitHub Desktop.
Save ImIOImI/5da3e82574fdb96f252d6eadf3cdce5a to your computer and use it in GitHub Desktop.
Simple script to add a symbolic link into a user's bin folder
param (
[Parameter(Mandatory=$true)][string]$path
)
$file = Split-Path $path -leaf
$file = "~/bin/$file"
if(Test-Path $file){
Write-Host "$file already exists" -ForegroundColor Red
exit
}
New-Item -ItemType SymbolicLink -Path $file -Target $path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment