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 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 7 years and 1 month 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
calgarycoc
Posts: 11
Last visit: Thu Feb 01, 2024 10:45 am

Scripts created in 2012/2016 not working in 2017

Post by calgarycoc »

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
Last visit: Thu Mar 30, 2017 8:54 am

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

Post by juneblender »

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
calgarycoc
Posts: 11
Last visit: Thu Feb 01, 2024 10:45 am

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

Post by calgarycoc »

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
Last visit: Thu Mar 30, 2017 8:54 am

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

Post by juneblender »

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 5867 times
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

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

Post by davidc »

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 5859 times
Note: We have a number of users who use the VMWare module within PowerShell Studio 2016.
David
SAPIEN Technologies, Inc.
User avatar
calgarycoc
Posts: 11
Last visit: Thu Feb 01, 2024 10:45 am

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

Post by calgarycoc »

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
calgarycoc
Posts: 11
Last visit: Thu Feb 01, 2024 10:45 am

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

Post by calgarycoc »

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: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

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

Post by Alexander Riedel »

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
calgarycoc
Posts: 11
Last visit: Thu Feb 01, 2024 10:45 am

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

Post by calgarycoc »

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: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

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

Post by Alexander Riedel »

Do you have this folder: C:\Program Files (x86)\Common Files\SAPIEN Debugger 2016 ?
What files are in it?
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 7 years and 1 month 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.