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 SUBSCRIPTION NUMBERS, LICENSE 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.
User avatar
StupidSexyFlanders
Posts: 107
Joined: Sun Nov 27, 2011 9:22 am

Cannot run PowerShell v3 script in PSS 3.1.26

Post by StupidSexyFlanders » Tue Nov 12, 2013 3:58 pm

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 2663 times
Mike

User avatar
Alexander Riedel
Posts: 7049
Joined: Tue May 29, 2007 4:43 pm

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by Alexander Riedel » Tue Nov 12, 2013 6:11 pm

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.

User avatar
StupidSexyFlanders
Posts: 107
Joined: Sun Nov 27, 2011 9:22 am

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by StupidSexyFlanders » Wed Nov 13, 2013 10:54 am

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
Joined: Thu Aug 18, 2011 4:56 am

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by davidc » Wed Nov 13, 2013 11:38 am

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.

User avatar
StupidSexyFlanders
Posts: 107
Joined: Sun Nov 27, 2011 9:22 am

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by StupidSexyFlanders » Wed Nov 13, 2013 4:23 pm

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 2626 times
Mike

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by davidc » Wed Nov 13, 2013 4:57 pm

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
Joined: Thu Aug 18, 2011 4:56 am

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Post by davidc » Wed Nov 13, 2013 4:59 pm

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.