ActiveXPosh and VirtualMachineManager

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
This topic is 14 years and 8 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.
User avatar
momoca
Posts: 2
Last visit: Sat Feb 28, 2015 3:01 am

ActiveXPosh and VirtualMachineManager

Post by momoca »

Can someone please help me? Has anyone got ActiveXPosh and VirtualMachineManager to work for them? I'd appreciate any help or advice. Thanks!

Option Explicit Dim ActiveXPosh Dim Command Const OUTPUT_CONSOLE = 0 Const OUTPUT_WINDOW = 1 Const OUTPUT_BUFFER = 2 Function CreateActiveXPosh() Dim success Set ActiveXPosh = CreateObject("SAPIEN.ActiveXPoSH") success = ActiveXPosh.Init(vbFalse) If success <> 0 then WScript.Echo "Init failed" end if ActiveXPosh.OutputMode = OUTPUT_CONSOLE End Function CreateActiveXPosh
ActiveXPosh.Execute("Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager")

Command = "Get-VM"

ActiveXPosh.Execute(Command)
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

ActiveXPosh and VirtualMachineManager

Post by Alexander Riedel »

It would help if you would elaborate on what error you get.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
momoca
Posts: 2
Last visit: Sat Feb 28, 2015 3:01 am

ActiveXPosh and VirtualMachineManager

Post by momoca »

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 2.At line:1 char:13+ Add-PSSnapin <<<< Microsoft.SystemCenter.VirtualMachineManager + CategoryInfo : InvalidArgument: (Microsoft.Syste...lMachineManager:String) [Add-PSSnapin], PSArgumentException + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommandThe term 'get-vm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At line:1 char:7+ get-vm <<<< + CategoryInfo : ObjectNotFound: (get-vm:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

ActiveXPosh and VirtualMachineManager

Post by Alexander Riedel »

The error clearly indicates that the snapin is not installed. Are you trying to access a 64 bit snapin from a 32 bit component?
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 14 years and 8 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.