Created
March 9, 2017 09:47
-
-
Save yattom/8bccc41b5fbd0e43f3ef6f7473f746d7 to your computer and use it in GitHub Desktop.
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
function prompt() { | |
Write-Host "[" -nonewline | |
Write-Host "$(Get-Location)" -foregroundcolor Cyan -nonewline | |
Write-Host "]" -nonewline | |
Write-Host " ${env:USERNAME}@${env:COMPUTERNAME}" -foregroundcolor Magenta | |
"> " | |
} | |
function Add-Path($path) { | |
if("" -eq $path) { | |
return | |
} | |
if($env:Path.Contains($path + ";")) { | |
return | |
} | |
Set-Item env:Path "${path};${env:Path}" | |
} | |
# utility | |
Add-Path $home\tools | |
# python | |
Add-Path $home\tools\python3 | |
Add-Path $home\tools\python3\Scripts | |
Set-Alias which Which-Command | |
function Which-Command($cmd) { | |
$obj = Get-Command $cmd | |
switch($obj.CommandType) { | |
"Alias" { "Alias -> " + $obj.ResolvedCommand.Name} | |
"Cmdlet" { "Cmdlet (" + $obj.Source + ")" } | |
"Function" { $obj.Definition } | |
default { ($obj.Source) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment