DSorlov / Sorlov.PowerShell

This is the public version of Sorlov.PowerShell Self-Hosted Executable Extensions for Powershell
http://the.powershell.zone/software/sorlov-powershell/
GNU General Public License v3.0
26 stars 8 forks source link

making exe from a script having argument seems to be not working #5

Open orlith opened 3 years ago

orlith commented 3 years ago

Hello I'm trying to convert to an exe file a simple script that needs 2 arguments. Running the ps1 populates the 2 variable with the 2 arguments I passed Running the exe (made with the same ps1) returns only default value Investigating shows that variables are not populated .

Here is the simple code test.ps1 Param([STRING]$clipboard = "defaultvalue", [STRING]$APP = "test",[SWITCH]$SELECT) Write-Host "Text: $clipboardnAppli: $app"`

so running "test.exe param1 param2" returns text:defaultvalue Appli:test where runing t he ps1 returns : text:param1 Appli:param2

Building the exe using PS2EXE instead of New-SelfHostedPS solve my issue. With PS2EXE conversion polulating variables from a passed arguments works fine.

Is that bug or am I doing something wrong ?

Thx

DSorlov commented 3 years ago

Looking into this. Not sure if I will fix sue to the severe lag in the library (have not been kept up 2 date). Will update as soon as I had a chance to check it out.