Compiled EXE Switch Parameter

Use this forum to ask about non-product related topics (login issues, product registrations, web site questions, etc.) No technical support questions, please.
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.
This topic is 6 months and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Fatal_Err
Posts: 6
Last visit: Thu Apr 25, 2024 5:39 pm

Compiled EXE Switch Parameter

Post by Fatal_Err »

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
}
User avatar
Alexander Riedel
Posts: 8575
Last visit: Fri Nov 01, 2024 6:19 am
Answers: 23
Been upvoted: 42 times

Re: Compiled EXE Switch Parameter

Post by Alexander Riedel »

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.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 6 months and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.