PrimalScript 2014 and PowerShell V2 packager

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 9 years and 7 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
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

PrimalScript 2014 and PowerShell V2 packager

Post by clum09 »

Hello,

I write a script that uses Get-WindowsFeature cmdlet from Windows Server 2012 R2.

I packaged this script with PrimalScript 2014 and the Engine type is SAPIEN PowerShell V2 Host (Command line)x64 or SAPIEN PowerShell V2 Host (Command line) Any platform.

The the only piece of code I used is:

Code: Select all

Get-WindowsFeature
When I launched the packaged script, I got the following error message:

ERROR: Get-WindowsFeature : The term 'Get-WindowsFeature' is not recognized as the nam
ERROR: e of a cmdlet, function, script file, or operable program. Check the spelling o
ERROR: f the name, or if a path was included, verify that the path is correct and try
ERROR: again.
ERROR:
ERROR: At line:14 char:19
ERROR: + Get-WindowsFeature <<<<
ERROR: + CategoryInfo : ObjectNotFound: (Get-WindowsFeature:String) [],
ERROR: CommandNotFoundException
ERROR: + FullyQualifiedErrorId : CommandNotFoundException
ERROR:

It looks like PrimalScript 2014 does not support the Microsoft Server Manager cmdlets with PowerShell V2 packager at this point.

I would appreciate it if someone can let me know the reason why?

Thank you in advance.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PrimalScript 2014 and PowerShell V2 packager

Post by jvierra »

PowerShell V2 does not support the extended Net classes and cannot auto load commands. Do not use PowerShell V2 setting.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PrimalScript 2014 and PowerShell V2 packager

Post by jvierra »

I should also note that this command is only available on Windows 2008R2 and later and can only target Windows Server 2008R2 and later Servers only. It cannot target client systems.

See:
http://msdn.microsoft.com/en-us/library/ee662312.aspx
http://technet.microsoft.com/en-us/libr ... 05469.aspx
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript 2014 and PowerShell V2 packager

Post by Alexander Riedel »

I have to point out the obvious here that this has nothing to do with PrimalScript or our packager.

As JVierra pointed out, PowerShell V2 does not support this.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 9 years and 7 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.