PowerTip: Is It a PowerShell Alias?

PowerTip: Is It a PowerShell Alias?

  • Comments 2
  • Likes

Summary: Quickly find multiple Windows PowerShell aliases.

Hey, Scripting Guy! Question I have a bunch of Windows PowerShell commands I have been using, but they seem to act strangely sometimes.
          I need to know if they are aliases or real commands. How can I tell?

Hey, Scripting Guy! Answer Use the Get-Alias cmdlet to look up aliases and resolve them to Windows PowerShell cmdlet names.
          You can do this in a single command because the –Name parameter accepts an array of aliases, for example:

Get-Alias -Name sort, select, foreach, where, dir, cls

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • I wrote a function named Whatis in PowerShell that allows you to do queries like Whatis dir to find out, in this case if dir is an alias or not. Download it from: http://sp.ntpcug.org/PowerShell/Shared%20Documents/Larry_Weiss_WhatIs_function.ps1