PowerShell script exchange
Post Reply
c82djau
Novice
Posts: 3
Liked: 1 time
Joined: Jun 18, 2015 2:00 pm
Full Name: c82djau
Contact:

Add-PSSnapin -Name VeeamPSSnapIn from apache cgi-bin

Post by c82djau »

Hi, I have a probleme to load Veeam library from a apache cgi-bin shell forked from a python script.

write-host $PSVersionTable.PSVersion
get-pssnapin | write-host
Add-PSSnapin -Name VeeamPSSnapIn
get-pssnapin | write-host
Add-PSSnapin -Name VMware.VimAutomation.Core
get-pssnapin | write-host

output:
3.0
Microsoft.PowerShell.Core
Microsoft.PowerShell.Core
Microsoft.PowerShell.Core
VMware.VimAutomation.Core

If i open a powershell console and type :
Add-PSSnapin -Name VeeamPSSnapIn
get-pssnapin | write-host

output correctly :
Microsoft.PowerShell.Core
VeeamPSSnapIn

I have no probleme with the load of vmware lib.

Thanks.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Add-PSSnapin -Name VeeamPSSnapIn from apache cgi-bin

Post by veremin »

Personally I don't any relevant experience in such scenarios, but are you running scripts on 64-bit OS? If so, be aware that typically there are two PS instances in this case - 32 and 64 ones. Is it possible that snap-in isn't registered on the one that you're trying to execute?
c82djau
Novice
Posts: 3
Liked: 1 time
Joined: Jun 18, 2015 2:00 pm
Full Name: c82djau
Contact:

Re: Add-PSSnapin -Name VeeamPSSnapIn from apache cgi-bin

Post by c82djau » 1 person likes this post

Veeam register dll only for a 64 bits powershell.
I have to remove old apache 32 and python 32, install apache 64, python 64 and start C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe and not C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Add-PSSnapin -Name VeeamPSSnapIn from apache cgi-bin

Post by veremin »

Ok, so as I expected the problem was related to attempt to register PS snap-in in 32 environment. Glad to hear that you're up and running now.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Baidu [Spider] and 8 guests