Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

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

@orlith

Description

@orlith

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions