title: Is there a way to create an alias to a cmdlet in a way that it only runs if arguments are passed to the alias?
body: <p>I am trying to <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-alias?view=powershell-6" rel="noreferrer">create an alias</a> (named <strong>which</strong>) of the <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/get-command?view=powershell-6" rel="noreferrer">Get-Command</a> cmdlet in a way that it doesn't run if I'm not sending any arguments (because if it's run without arguments it outputs all the commands that are available).</p>
  
  <p>I know this can be done using a function but I would like to keep the tab completion functionality without having to write a sizeable function that is to be placed into my <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-6#the-profile-variable" rel="noreferrer">$PROFILE</a>.</p>
  
  <p>In short, I only want the alias to work if it is being passed arguments.</p>