I work in a mixed Sharepoint environment where I have developed a number of GUI utilities for use by the Operations team. A stumbling block has always been that a packaged .exe file will not run in our Sharepoint 2010 environment when it is necessary to load the Sharepoint snapin. This seems to be because the host always defaults to the highest version of Powershell. Whatever I have tried to overcome this limitation up to this point has proved useless. As a result, I have to package/deploy as a .PS1 file. I would rather the Operations team not have access to alter the script itself.
Is there any way to force a packaged executable to run on a specific (i.e. Lower) version of Powershell? On our Sharepoint farms versions higher than 2010 this is not a problem.
Forcing Powershell GUI .exe to run under version 2
Forum rules
Do not post any licensing information in this forum.
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 any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- Squidge123
- Posts: 4
- Last visit: Mon Mar 04, 2024 10:08 am
Re: Forcing Powershell GUI .exe to run under version 2
You cab set the target version of the engine in the settings for your build. "Deploy" tab, "Packager" "Settings". Select Engine for V2 host.
To force forms to be built for V2 engine set the platform settings (Home tab) to build for V2 - 64 bit.
To force forms to be built for V2 engine set the platform settings (Home tab) to build for V2 - 64 bit.