Last active
July 15, 2020 02:20
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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