Scripts created in 2012/2016 not working in 2017

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
androidbill
Posts: 11
Joined: Tue Apr 12, 2016 8:10 am

Scripts created in 2012/2016 not working in 2017

Post by androidbill » Wed Jan 18, 2017 8:28 am

I have many scripts that I created in PowerShell Studio 2012, then eventually upgraded to 2016, and created new scripts there. However after the last batch of updates for 2016, and now 2017. I am unable to get my scripts working. I tried to load them in 2012, but that no longer works, as they changed the file extension, and you cant load a 2016 file in 2012. All of my scripts are powershell forms .psf Not powershell projects.
I need to download PowerShell Studio 2016 5.2.129 or even older I guess to get them working again.

For example I have a script that I created and works fine in the older 2016 that loads the vmware snappin, and I am able to perform actions against our vcenter, this no longer works in 2017. Its like it doesnt know I have vmware installed? I tried building a new cache, and rebuilding the cache, that does not work.
"Connect-VIServer not recognized as the name of a cmdlet .... " etc.
Some one please help.

User avatar
juneblender
Posts: 93
Joined: Thu Jul 24, 2014 3:26 pm

Re: Scripts created in 2012/2016 not working in 2017

Post by juneblender » Wed Jan 18, 2017 8:33 am

Hi, Bill, thanks for posting. To solve this, we need specifics. Can you please give us an example of a script that's not working and, specifically, what "not working" means, including the text of any error messages that are being returned? -- juneb

User avatar
androidbill
Posts: 11
Joined: Tue Apr 12, 2016 8:10 am

Re: Scripts created in 2012/2016 not working in 2017

Post by androidbill » Wed Jan 18, 2017 8:38 am

June can I email you? As I sid I use powershell forms .psf not powershell projects, I can copy and paste my script into an email and send to you.

for example in 2017 I click File / New / New Form / Empty Form
In the script under the Form1_Load section I type this

Add-PSSnapin *vmware*
$VC = Connect-VIServer Vcenter01

Upon running the script it says:
ERROR: Connect-VIServer : The term 'Connect-VIServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
ERROR: the name, or if a path was included, verify that the path is correct and try again.
PowerOffVM.psf (5, 8): ERROR: At Line: 5 char: 8
ERROR: + $vc = Connect-VIServer pivcenter501

User avatar
juneblender
Posts: 93
Joined: Thu Jul 24, 2014 3:26 pm

Re: Scripts created in 2012/2016 not working in 2017

Post by juneblender » Wed Jan 18, 2017 8:48 am

To answer your FB question: " in the meantime where can I download the 2016 5.2.129 version so I can at least start updating my scripts again."

On your Registered Products page (https://www.sapien.com/account/products), in the PowerShell Studio row, click Archives.
Screenshot 2017-01-18 08.40.58.png
Screenshot 2017-01-18 08.40.58.png (74.51 KiB) Viewed 2311 times

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

Re: Scripts created in 2012/2016 not working in 2017

Post by davidc » Wed Jan 18, 2017 9:29 am

Try loading it as a module instead of a PSSnapin. I believe they ported it over to the module from a snapin.

Also, check your platform settings and verify that you have the correct version of PowerShell selected and the correct bitness (32 vs 64 bit.)
Platform Settings.png
Platform Settings.png (12.98 KiB) Viewed 2303 times
Note: We have a number of users who use the VMWare module within PowerShell Studio 2016.
David
SAPIEN Technologies, Inc.

User avatar
androidbill
Posts: 11
Joined: Tue Apr 12, 2016 8:10 am

Re: Scripts created in 2012/2016 not working in 2017

Post by androidbill » Wed Jan 18, 2017 10:27 am

I uninstalled and reinstall PowerShell Studio 2016 different versions many times now, and each time I get this upon trying to run one of my scripts

“Cannot instantiate PowerShell V5 object: 80070002>> Script Ended”
“Cannot instantiate PowerShell V2 object: 80070002>> Script Ended”

User avatar
androidbill
Posts: 11
Joined: Tue Apr 12, 2016 8:10 am

Re: Scripts created in 2012/2016 not working in 2017

Post by androidbill » Wed Jan 18, 2017 10:29 am

Also I can share my screen with you so you can see first hand whats happening, and you can take control as well, no problem.

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

Re: Scripts created in 2012/2016 not working in 2017

Post by Alexander Riedel » Wed Jan 18, 2017 11:20 am

Rebuilding the cache is only relevant for intellisense. Uninstalling and re-installing rarely solves anything and usually makes Windows Installer screw up your system.
The best way to solve a problem is to go one step at a time rather than throwing everything against the wall to see if somethings sticks.

From the above posts I see that you have either a problem running scripts altogether OR getting an error about VMWare when running a script.
Since these are mutually exclusive you need to tell us what your current state is. Which version of PowerShell Studio do you have installed?
Can you run a simple Hello World script?
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
androidbill
Posts: 11
Joined: Tue Apr 12, 2016 8:10 am

Re: Scripts created in 2012/2016 not working in 2017

Post by androidbill » Wed Jan 18, 2017 11:22 am

As of right now I have Powershell Studio 2016 5.2.131 installed
I am unable to run any scripts as now Im getting the “Cannot instantiate PowerShell V5 object: 80070002>> Script Ended”

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

Re: Scripts created in 2012/2016 not working in 2017

Post by Alexander Riedel » Wed Jan 18, 2017 11:34 am

Do you have this folder: C:\Program Files (x86)\Common Files\SAPIEN Debugger 2016 ?
What files are in it?
Alexander Riedel
SAPIEN Technologies, Inc.