$ExecutionContext.SessionState.InvokeCommand.PreCommandLookupAction = {# is called whenever a command is ready to executeparam($command, $eventArgs)# not executed internally by PowerShellif ($command-eq'Get-Service' -and $eventArgs.CommandOrigin -eq'Runspace') {# tell PowerShell what to do instead of# running the original command$eventArgs.CommandScriptBlock = {# run the original command without "*", and# submit original arguments if there have been any$command = 'dir' $( if ($args.Count -eq0) { & $command }else { & $command$args } ) }.GetNewClosure() }}