Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. $ExecutionContext.InvokeCommand.CommandNotFoundAction = {
  2. param([string]$CommandName, [System.Management.Automation.CommandLookupEventArgs]$evtArgs)
  3.  
  4. if($CommandName -like '*glue*'){
  5. $evtArgs.CommandScriptBlock = {
  6. Write-Host "Eating glue because of $CommandName ..." -ForegroundColor Green
  7. }.GetNewClosure()
  8. $evtArgs.StopSearch = $true
  9. }
  10. }
  11.  
  12. Get-GlueStuff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement