PowerShell Studio 2018 v5.5.152
64 bit version of product:
Operating system:
64 bit OS:
The .exe produced by running the Packager from PowerShell Studio 2018 works correctly.
When using the command line tool 'psbuild' with the /PACKAGE option the .exe produced does not work.
The error displayed suggests that the .ps1 files that contain the required functions are not in the .exe.
Again, this works fine when packaged from PowerShell Studio GUI. We need the command line to work for our automated
build environment.
The output from PowershellStudio when it works: (I altered the names of our actual files.)
>> Package 'C:\GIT\tools\test.psproj'
>> Building (test) Project...
>> Merging 'Startup.pss' ...
>> Merging 'file1.ps1' ...
>> Merging 'file2.ps1' ...
>> Merging 'file3.ps1' ...
>> Merging 'file4.ps1' ...
>> Merging 'file5.ps1' ...
>> Merging 'file6.ps1' ...
>> Merging 'file7.ps1' ...
>> Merging 'file8.ps1' ...
>> Merging 'file9.ps1' ...
>> Writing 'test.Package.ps1' ...
SAPIEN Package and Deploy Tool 4.1 (c) 2005 - 2018 SAPIEN Technologies, Inc.
------ Build started: test, Configuration: x64 ------
Packaging with SAPIEN PowerShell V5 Host (Command line) x64
Adding C:\GIT\tools\test.Package.ps1
Writing scripts to bin\x64\test.exe
Embedding default manifest...
Package completed
>> Completed
The output from the 'psbuild' command when the .exe does not work:
C:\GIT\DG\hotfix_7.4.x\dgserver\hotfix\tools\services-stop>psbuild /PACKAGE "C:\GIT\tools\test.psproj.psbuild"
SAPIEN Package and Deploy Tool 4.1 (c) 2005 - 2018 SAPIEN Technologies, Inc.
------ Build started: test, Configuration: x64 ------
Packaging with SAPIEN PowerShell V5 Host (Command line) x64
Adding C:\GIT\tools\test.psproj
Writing scripts to bin\x64\test.exe
Embedding default manifest...
Package completed
It does seem obvious that the merging of the .ps1 files that contain required functions did not occur from the command line in the
same way that it did from the GUI.
Is my project missing a build option setting in order to get the command line to work for the same project file that works in PowerShell Studio?
Is there anything else that I might be doing wrong to cause this type of problem?
Your quick response would be very much appreciated.
-Regards
psbuild does not build a working .exe file.
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: psbuild does not build a working .exe file.
Since this is a project, you must run it from PowerShell Studio, because the script needs to be generated in order for PSBuild to package it.
Note: This also includes psf files.
Note: This also includes psf files.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: psbuild does not build a working .exe file.
David,
Thanks for the rapid response.
Can you suggest a different way for me to set this up so we can build an .exe from the command line?
What alternative approaches or options would you suggest? I want to be able to combine multiple .ps1 function files
and create a .exe using psbuild if at all possible. This is a requirement from our build team to be able to automate the
creation of the .exe.
Regards,
-Bob
Thanks for the rapid response.
Can you suggest a different way for me to set this up so we can build an .exe from the command line?
What alternative approaches or options would you suggest? I want to be able to combine multiple .ps1 function files
and create a .exe using psbuild if at all possible. This is a requirement from our build team to be able to automate the
creation of the .exe.
Regards,
-Bob
Re: psbuild does not build a working .exe file.
For the projects, there isn't a command line option at this time, but it is on our TODO list.
An alternate method would be to export the project to a ps1 file and automate the building of the exported script instead.
An alternate method would be to export the project to a ps1 file and automate the building of the exported script instead.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: psbuild does not build a working .exe file.
Thanks for your help so far. I'm new to Powershell Studio.
I see how to export the scripts and it produced a single .ps1 file
that contained all of the .ps1 files.
My questions are:
Thanks for your help.
-Regards
I see how to export the scripts and it produced a single .ps1 file
that contained all of the .ps1 files.
My questions are:
- How would I take the combined .ps1 file to produce the
.exe file that I want to deliver to our customers.
- What type of project would I use to do that?
- How would I use psbuild to do this for me in an automated fashion?
Thanks for your help.
-Regards
Re: psbuild does not build a working .exe file.
To create the ps1 from a project go to Ribbon->Deploy->Export->Export to File:
Any project that is not a Collection or Module Project will work. You have to set the Build property of the project files to Include and it will merge the files into the exported script.
As for an example project, simply create a new Multi-Form project and it will merge the files into a single script when exported.
Any project that is not a Collection or Module Project will work. You have to set the Build property of the project files to Include and it will merge the files into the exported script.
As for an example project, simply create a new Multi-Form project and it will merge the files into a single script when exported.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: psbuild does not build a working .exe file.
David,
That's the step that I knew how to do; see my previous post. How do you turn the combined .ps1 file into a .exe from the psbuild command?
I cant get that part to work.
Regards,
Bob
That's the step that I knew how to do; see my previous post. How do you turn the combined .ps1 file into a .exe from the psbuild command?
I cant get that part to work.
Regards,
Bob
Re: psbuild does not build a working .exe file.
Here are the steps you need to take:
1. Export the project to ps1 file.
2. Open the exported ps1 file in PowerShell Studio (Press No on all the prompts because it is an exported file)
3. Configure the Packager settings for the exported script.
4. Call PSBuild.exe and pass the exported script's psbuild file as a parameter:
I don't recommend editing the exported script. Always work in the project itself and export the changes.
1. Export the project to ps1 file.
2. Open the exported ps1 file in PowerShell Studio (Press No on all the prompts because it is an exported file)
3. Configure the Packager settings for the exported script.
4. Call PSBuild.exe and pass the exported script's psbuild file as a parameter:
Code: Select all
PSBuild /PACKAGE "C:\GIT\tools\test.Export.ps1.psbuild"
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: psbuild does not build a working .exe file.
David,
These were exactly the steps that I needed. I was able to create the project as you described and use the psbuild command to create the .exe that ran fine. It would be neat if you guys could combine this so that I would not have to do the export
step manually and use a different project file. Maybe a simple /PACKAGE_EXPORT command
Thanks for your help,much appreciated.
Regards,
Bob
These were exactly the steps that I needed. I was able to create the project as you described and use the psbuild command to create the .exe that ran fine. It would be neat if you guys could combine this so that I would not have to do the export
step manually and use a different project file. Maybe a simple /PACKAGE_EXPORT command
Thanks for your help,much appreciated.
Regards,
Bob
Re: psbuild does not build a working .exe file.
Yes, creating a more seamless approach is on our TODO list.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.