Convert ps1 to exe and add parameters

363 Views Asked by At

Good day!

I have a ps1 script with this first line: param ($path)

I need it to execute some command at the end of the script like: .\file.exe $path

I know this is working because if I execute the script.ps1 -path "some_path" works fine.

The problem is, I'm using Powershell Packager (Ironman Software Powershell Packager) to convert the .ps1 into .exe file but when I try to run the "script.exe -path "some_path" is not working

Do you know how can I pass parameters to the exe file?

EDIT: I WILL CLOSE THIS, SINCE I FOUND HOW TO DO IT DIRECTLY IN C#

Thanks for your help

1

There are 1 best solutions below

2
Trollfat On

Are you sure that those executables made by the software can receive parameters?

Is there a reason why you can’t just rewrite the scripts to prompt user input for a path once the executable runs?