Product, version and build: Primalscript 7.2.82
32 or 64 bit version of product: x64
Operating system: Win 8.1 x64
32 or 64 bit OS:
I am using the script packager for the first time and wanted to know if there's a way for my powershell script to be setup to use the target systems powershell engine based on the default architecture? So the exe will only call the powershell.exe on the machine and pass my .ps1 to it for execution.
Thanks for any help/advice.
Mike
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Use native engine in package scripts?
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.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Use native engine in package scripts?
Yes. Choose the "Microsoft Windows Powershell (Command line)" engine fitting your platform (x64 or Win32)
It will create a temporary file during execution though. Just so you are aware.
FYI, the SAPIEN PowerShell host engines also use the "native" powershell engine. They just do not use temporary files or powershell.exe
It will create a temporary file during execution though. Just so you are aware.
FYI, the SAPIEN PowerShell host engines also use the "native" powershell engine. They just do not use temporary files or powershell.exe
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Use native engine in package scripts?
In the Engine Type pull down it looks like I have to specifically select either the Win32 or x64 engine. I don't see a 'native' choice so that it would just use the engine for the architecture that the command is being run on. For an example if I write a .cmd file that says powershell.exe -command .\test.ps1 this will use the correct bitness powershell based on the architecture of the machine. I'm looking to replicate that in a more properly wrapped exe, if possible.
Thanks for the help!
Mike
Thanks for the help!
Mike
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Use native engine in package scripts?
Yeah, I guess that could be done. It would have to always be a 32 bit process.
I'll see what we can cook up.
I'll see what we can cook up.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Use native engine in package scripts?
Add the engine in the attached zip file to your installation and see if that does what you want.
- Attachments
-
- Microsoft Windows PowerShell (Command line) Native.zip
- (55.41 KiB) Downloaded 189 times
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Use native engine in package scripts?
Thanks for the exe, just getting that is incredible support. In attempting to test this I am getting an error of: 'Cannot run Script, error: The system cannot find the file specified. (image attached) Is this something I'm doing wrong? The .ps1 is in the same directory as the exe and the files the ps1 need (App-V related files).
- Attachments
-
- SapienPackagerExe-Error.png (7.07 KiB) Viewed 5861 times
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Use native engine in package scripts?
umm. Ok, let me check.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Use native engine in package scripts?
Ok, try this one.
You do not need to deploy the script file with the exe, it is packaged inside.
You do not need to deploy the script file with the exe, it is packaged inside.
- Attachments
-
- Microsoft Windows PowerShell (Command line) Native.zip
- (55.05 KiB) Downloaded 181 times
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Use native engine in package scripts?
This worked perfectly! It imported the App-V Powershell cmdlet in the proper architecture on both x86 and AMD64 machines. Thank you very much for the assistance!
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Use native engine in package scripts?
Glad to hear it. This will be part of the next service build.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.