Page 1 of 1

Cannot run PowerShell v3 script in PSS 3.1.26

Posted: Tue Nov 12, 2013 3:58 pm
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.

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Posted: Tue Nov 12, 2013 6:11 pm
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.

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Posted: Wed Nov 13, 2013 10:54 am
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:)

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Posted: Wed Nov 13, 2013 11:38 am
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

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Posted: Wed Nov 13, 2013 4:23 pm
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.

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Posted: Wed Nov 13, 2013 4:57 pm
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

Re: Cannot run PowerShell v3 script in PSS 3.1.26

Posted: Wed Nov 13, 2013 4:59 pm
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