Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ExecutionContext.InvokeCommand.CommandNotFoundAction = {
- param([string]$CommandName, [System.Management.Automation.CommandLookupEventArgs]$evtArgs)
- if($CommandName -like '*glue*'){
- $evtArgs.CommandScriptBlock = {
- Write-Host "Eating glue because of $CommandName ..." -ForegroundColor Green
- }.GetNewClosure()
- $evtArgs.StopSearch = $true
- }
- }
- Get-GlueStuff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement