Packaged Powershell Script

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years and 5 months 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.
User avatar
gepewitt
Posts: 5
Last visit: Thu Nov 24, 2022 7:09 am

Packaged Powershell Script

Post by gepewitt »

Hello,

I tried searching the Powershell Studio forms first for posts regarding Packaging of scripts but could not find any information on my issue.

I have packaged several scripts that when run through the console prompt the user to enter a value based off of a list that I displayed via Write-Host. Similar to below.

Select Option:
1. Enable User
2. Disable User
3. Remove User

This functionality works fine. However when I package the script and run it as an EXE the dialog box for the prompt only shows the first line of the output and not the following lines so all I see in the dialog box when I run the packaged script is "Select Option:".

Is there a way to change the size of the dialog box that is displayed when running the packaged script?

Thanks in advance for the assistance.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Packaged Powershell Script

Post by davidc »

There are various host/ platforms you can use when packaging. If you are using command line prompts then I recommend you select the Command line platform instead of the Windows platform.

For more information on packaging I recommend searching our blog or access the PowerShell Studio manual:

http://www.sapien.com/blog/2012/10/17/p ... io-manual/

David
David
SAPIEN Technologies, Inc.
User avatar
gepewitt
Posts: 5
Last visit: Thu Nov 24, 2022 7:09 am

Packaged Powershell Script

Post by gepewitt »

David,

Thank you for the response. However, I have looked in the User Manual and did not see anything regarding chaning the dialog box size. There was information regarding the options in the packaging wizard. I packaged the script with each of the various host / platform options but received the same result as previously mentioned when I selected the Windows package. The command line package doesn't really help that much, we could just run in manually via Powershell.

Any other ideas or changing the dialog box size or getting it to autosize?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Packaged Powershell Script

Post by davidc »

Unfortunately you cannot change the dialog size. It should be determined automatically and auto size to its content. Can you post some screenshots illustrating the issue?

Another option is to create a simple GUI with a few textboxes for input and outputs. That way you have more control over the presentation.

David
David
SAPIEN Technologies, Inc.
User avatar
gepewitt
Posts: 5
Last visit: Thu Nov 24, 2022 7:09 am

Packaged Powershell Script

Post by gepewitt »

David,

Here is the code that I am referring to and the screenshot has been attached.

$userJob = Read-Host "Select Department:`n 1. Accounting`n 2. Asset Recovery`n 3. Compliance`n 4. Credit Analyst`n 5. Customer Care`n 6. Deposit Services`n 7. Human Resources`n 8. Loan Services`n 9. Maintenance`n10. Marketing`n11. Technology`n12. Treasury Management`n"

Thank you for the information and responsiveness to this issue.


Attached files
User avatar
gepewitt
Posts: 5
Last visit: Thu Nov 24, 2022 7:09 am

Packaged Powershell Script

Post by gepewitt »

Attached is another screenshot of the dialog box for the code I added to the previous post. The screenshot in the previous post shows the same action with similar code.

Attached files
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Packaged Powershell Script

Post by davidc »

Ok now I see what the problem is.
I will add a Wish List request for input boxes with multiline support. In the meantime I recommend placing the text on a single line.

When dealing with multiple choices like this, I recommend a GUI with a combo box.

David
David
SAPIEN Technologies, Inc.
User avatar
gepewitt
Posts: 5
Last visit: Thu Nov 24, 2022 7:09 am

Packaged Powershell Script

Post by gepewitt »

David,

Thanks I will give that a try.
This topic is 11 years and 5 months 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.