title: How to check if a cmdlet exists in PowerShell at runtime via script
body: <p>I have a PowerShell script that needs to run under multiple hosts (PowerGUI, <a href="https://technet.microsoft.com/en-us/library/dd315244.aspx" rel="noreferrer">PowerShell ISE</a>, etc...), but I am having an issue where sometimes a cmdlet doesn't exist under one of the hosts. Is there a way to check to see if a cmdlet exists so that I can wrap the code in an if block and do something else when it does not exist?</p>
  
  <p>I know I could use the <code>$host.name</code> to section the code that is suppose to run on each host, but I would prefer to use <a href="http://msdn.microsoft.com/en-us/library/ms537509(VS.85).aspx#DetectFtr" rel="noreferrer">Feature Detection</a> instead in case the cmdlet ever gets added in the future.</p>
  
  <p>I also could use a try/catch block, but since it runs in managed code I assume there is away to detect if a cmdlet is installed via code.</p>