To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build: Powershell Studio 2021
Operating system:Windows 10
PowerShell version(s): 5
*** Please add details and screenshots as needed below. ***
DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
I am very new to PS Studio and also to powershell... My first question is about create a .exe from my scripts that I am working on. Currently I have a simple script that I am trying to convert to an .exe after I finished it.
I went to this site on your blog to go through and see if I could figure it out but each of the options to convert it to a .exe would create a .config file that is an XML configuration file also and the .exe would not work without it. I was assuming if it converts to a .exe that there would be no need for other files for the .exe to work....
I tried the V5 host (Windows Application) and just the Windows option and both created the .xml config file and the .exe would not work standalone without it.
Is there a way to convert the .ps1 to a .exe with just the output being a standalone .exe file?
Thank you.
Question on Creating .EXE from current script.
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.
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.
Re: Question on Creating .EXE from current script.
If you do not want a .config file to be generated, it can be turned off in the SAPIEN Script Packager Output Settings tab under Packager options:
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Question on Creating .EXE from current script.
.NET applications generally require the config file. PowerShell is .NET based. That is how Microsoft designed that. We would not generate that file unless it is necessary.
You can read more about it here: https://docs.microsoft.com/en-us/dotnet ... gure-apps/
Why does that file bother you?
If you move to PowerShell 7 and .NET Core, a packaged application is a good number of files in a folder. That is just how it is.
You can read more about it here: https://docs.microsoft.com/en-us/dotnet ... gure-apps/
Why does that file bother you?
If you move to PowerShell 7 and .NET Core, a packaged application is a good number of files in a folder. That is just how it is.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Question on Creating .EXE from current script.
When coding in PowerShell and other formats I am just used to working with a single file. Since all of the PowerShell scripts I have made so far have not required any other external files other then the .ps1 but the .exe I am finding now is different. Like I said I am new to PowerShell and still learning.
So if the .xml is not included and ran with the .exe after conversion it will not work with full functionality since it will break some of the .net functionality?
One more thing that was interesting was when I ran the .exe it also open the .config file. If I run a .exe file I would not want the config file to open in addition every time as the .exe runs.
So if the .xml is not included and ran with the .exe after conversion it will not work with full functionality since it will break some of the .net functionality?
One more thing that was interesting was when I ran the .exe it also open the .config file. If I run a .exe file I would not want the config file to open in addition every time as the .exe runs.
Re: Question on Creating .EXE from current script.
Sorry. It doesn't open the .xml file it seems when I click on the .exe but it opens another window in addition to running the code with the same name as the .exe and its empty of information but has the File|EDIT|HELP at top.
- Attachments
-
- Screenshot 2021-10-07 082430.png (14.13 KiB) Viewed 6008 times
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Question on Creating .EXE from current script.
It does not open the config file in that manner. The .config file is usually required and should not be tampered with.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Question on Creating .EXE from current script.
Do you know why when I run the .exe its generating the other window in addition to the script? Script runs fine without displaying any other windows when in ps1 format. Run the .exe in any way and it generates the other window.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Question on Creating .EXE from current script.
From the information posted I cannot determine how you packaged your script exactly or what it is doing internally.
Most likely you are packaging a Form script using a Windows Application engine and not a Windows Forms engine. The preview window when selecting a packaging engine provides pertinent information.
Most likely you are packaging a Form script using a Windows Application engine and not a Windows Forms engine. The preview window when selecting a packaging engine provides pertinent information.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.