The problem is that iex is an alias in Powershell, short for Invoke-Expression . If you are trying to run the command iex.exe , iex.bat or iex.cmd , you will have to specify it in some unique way: an explicit (or full) path or even just adding an application extension may be enough. Therefore, Powershell will not launch Invoke-Expression .
Get-Command can fix this problem:
PS C:\Dir> Get-Command iex CommandType Name ModuleName ----------- ---- ---------- Alias iex -> Invoke-Expression PS C:\Dir> Get-Command cmd CommandType Name ModuleName ----------- ---- ---------- Application cmd.exe
It seems that it is impossible to specify both the type of the command and the path at the same time: if you want to see which iex is, you can use this form:
PS C:\Dir> Get-Command -All iex -Syntax Invoke-Expression C:\windows\iex.bat
You can learn more about how Powershell decides which team runs in the Microsoft Technology Library .
source share