A PS1 compiled to EXE does not recognize the passed parameters.
Posted on 2014-04-01
Powershell Newbie here.
Using PowerGUi Script Editor, I compile a PS1 to EXE. When I run the EXE it does not see the passed parameters. I am running them from the PowerShell Console in the PowerGUI Script Editor.
Here is the program code.
param([string]$foo , [string]$bar )
Write-Host "Arg0: $foo"
Write-Host "Arg1: $bar"
Write-Host "Arg2: $who"
Here are the test results
PS C:\test> .\blat2.exe it bugs me
PS C:\test> .\blat2.ps1 it bugs me
Being a newbie, I'm pretty sure I am making a rookie mistake.
How do I get the exe to recognize the passed parameters?