Skip to content

Instantly share code, notes, and snippets.

@fbehrens
Created July 8, 2021 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbehrens/a135887e418493c61f93a5e455a1d274 to your computer and use it in GitHub Desktop.
Save fbehrens/a135887e418493c61f93a5e455a1d274 to your computer and use it in GitHub Desktop.
profile
ipmo Microsoft.PowerShell.ConsoleGuiTools
$global:sysCode="C:\Users\fb\code"
if( $null -ne (get-psreadlineOption).PredictionSource ) {
Set-PSReadLineOption -PredictionSource History }
if( $null -ne (get-psreadlineOption).PredictionViewStyle ) {
Set-PSReadLineOption -PredictionViewStyle ListView }
function glg{
dir $sysCode -filter .git -Hidden -Recurse -Depth 2 |
% fullname |
% { $_ -replace [regex]::Escape($sysCode),""} |
% { $_ -replace "\\\.git$",""}
}
function cdg{
glg |
Out-ConsoleGridView -OutputMode Single |
% { Set-Location $sysCode\$_ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment