This file contains hidden or 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 ( | |
| [string]$Path, | |
| [string]$ClassName | |
| ) | |
| $scriptBody = @' | |
| using module {0} | |
| '@ -f $Path | |
| $script = [scriptblock]::Create($scriptBody) |
This file contains hidden or 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
| [CmdletBinding()] | |
| [OutputType([hashtable])] | |
| param ( | |
| [string]$Path, | |
| [string]$ClassName = '*' | |
| ) | |
| $moduleBase = Split-Path -Path $Path -Parent | |
| Write-Verbose "Module name - $fileName" |
This file contains hidden or 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
| $gitAliases = (git config --global -l).Where{ $_ -match '^alias\.'}.ForEach{$_ -replace '^alias\.(\w+).*', '$1'} | |
| $ExecutionContext.InvokeCommand.CommandNotFoundAction = { | |
| param ($name, $eventArgs) | |
| if ($name -in $gitAliases) { | |
| $alias = $name | |
| } elseif ($aliases = $gitAliases -match [regex]::Escape($name)) { | |
| $alias = $aliases | Sort-Object -Property Length | Select-Object -First 1 | |
| } | |
This file contains hidden or 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
| $ExecutionContext.InvokeCommand.CommandNotFoundAction = { | |
| param ($name, $eventArgs) | |
| @( | |
| "Boooo!" | |
| "Don't you know anything?" | |
| "RTFM!" | |
| "Hahaha, n00b!" | |
| "Wow! That was impressively wrong!" | |
| "He said: $name :D" | |
| "What are you doing??" |
This file contains hidden or 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
| Set-PSReadlineKeyHandler -Chord Spacebar -ScriptBlock { | |
| param ($key, $arg) | |
| $line = $null | |
| $cursor = $null | |
| [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState( | |
| [ref]$line, [ref]$cursor | |
| ) | |
| if ($cursor -lt 3) { | |
| return |
OlderNewer