Cannot run PowerShell v3 script in PSS 3.1.26

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 10 years and 4 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.
StupidSexyFlanders
Posts: 107
Last visit: Thu Apr 29, 2021 8:47 am

Cannot run PowerShell v3 script in PSS 3.1.26

Post by StupidSexyFlanders »

Noticed a previous post about this same issue with the fix in that case being the removal of the Exchange Management tools. However I don't use Exchange and am having a very similar issue.

In my case, I only have v2 and v4 (both x86 & x64), with no PSv3 available.
Attachments
psv3.JPG
psv3.JPG (18.08 KiB) Viewed 4211 times
Mike
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by Alexander Riedel »

You can only have PowerShell 3 OR PowerShell 4. Not both. They cannot coexist.
EDIT: Just to make this clear, this is not limitation of our products. Microsoft decided to arrange it that way....

And this has nothing to do with the other user where the exchange module crashes.
Alexander Riedel
SAPIEN Technologies, Inc.
StupidSexyFlanders
Posts: 107
Last visit: Thu Apr 29, 2021 8:47 am

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by StupidSexyFlanders »

Is there any kind of testing process or emulation that I that can use to tell me if the script I am writing will work on a system running only PSv3? Or is there way to tell if a cmdlet is exclusive to v4? Just don't want to create an amazing application only to fine it will only work on the (currently) infinitesimal percentage of PCs running PSv4:)
Mike
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by davidc »

I recommend importing the target (v3) machine's profile into PowerShell Studio. This allows you to see what cmdlets are available.

For more information, please refer to the following articles:

http://www.sapien.com/blog/2012/10/15/d ... es-part-1/

http://www.sapien.com/blog/2012/10/16/d ... es-part-2/

David
David
SAPIEN Technologies, Inc.
StupidSexyFlanders
Posts: 107
Last visit: Thu Apr 29, 2021 8:47 am

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by StupidSexyFlanders »

Excellent. That did the trick. Imported the W2K8 servers' cache (using the export tools) and now I have a fancy 'v3' option. :)
One question though: Does this mean that when I run my file it will be executing on the remote server? I don't it does, but wanted to make sure before I go nuts with this process.
Attachments
psv3ok.JPG
psv3ok.JPG (12.78 KiB) Viewed 4174 times
Mike
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by davidc »

If you specified remote credentials it will run on the remote computer when you press F5. Otherwise you need to specifically tell it to use PowerShell Remoting or the RSEE from the run menu.

David
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by davidc »

Also note that GUI scripts will not run on remote machines, because the GUI will display on the remote machine and not locally.


David
David
SAPIEN Technologies, Inc.
This topic is 10 years and 4 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.