I have a simple problem it seems. But can’t quite put my finger on it. I am using a multi form project in Powershell_studio. Switch parameters work fine in a ps1. But if trying to use switch parameters with the compiled exe, it seems to return nothing. This is the standard form which shows in startup.pss which is where the default form would start. After compiling, I am attempting the following. That simply opens the main form. I did try to return the value of the parameter. Also tried changing the parameter to a sting and passing some data with a return. Seems that nothing is being passed through or detected. Grateful for any help.
Start-Process -path “c:\temp\scipt.exe” -argumentlist ‘-NTFS_Admin’
function Main {
Param (
[Switch]$NTFS_Admin
)
if($NTFS_Admin){
if (Show-NTFSForm psf) -ea 'OK'){}
}
else{
if (Show-MainForm_psf) -eq 'OK'){}
}
$script:ExitCode = 0 #Set the exit code for the Packager
}
Compiled EXE Switch Parameter
Forum rules
Do not post any licensing information in this forum.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Do not post any licensing information in this forum.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
- Alexander Riedel
- Posts: 8575
- Last visit: Fri Nov 01, 2024 6:19 am
- Been upvoted: 42 times
Re: Compiled EXE Switch Parameter
Switch types do not exist outside of PowerShell. If you involve an executable file, that is not a thing.
Additionally, the parameters you defined for 'Main' are for that function, not the script or the executable. So they would not arrive there.
This sample here: https://www.sapien.com/blog/2019/06/27/ ... able-file/
shows how to make an executable with parameters, amongst other things.
For future reference, please post product support requests from an account associated with a license in the corresponding product forum.
The Customer Service forum is not meant for technical support. This forum section is generally monitored by sales staff.
Additionally, the parameters you defined for 'Main' are for that function, not the script or the executable. So they would not arrive there.
This sample here: https://www.sapien.com/blog/2019/06/27/ ... able-file/
shows how to make an executable with parameters, amongst other things.
For future reference, please post product support requests from an account associated with a license in the corresponding product forum.
The Customer Service forum is not meant for technical support. This forum section is generally monitored by sales staff.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.