Add-PSSnapin -Name VeeamPSSnapIn from apache cgi-bin

PowerShell script exchange

Add-PSSnapin -Name VeeamPSSnapIn from apache cgi-bin

Veeam Logoby c82djau » Tue Oct 13, 2015 12:33 pm

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.
c82djau
Novice
 
Posts: 3
Liked: 1 time
Joined: Thu Jun 18, 2015 2:00 pm
Full Name: c82djau

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

Veeam Logoby v.Eremin » Wed Oct 14, 2015 11:20 am

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?
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Veeam Logoby c82djau » Fri Oct 16, 2015 7:48 am 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
c82djau
Novice
 
Posts: 3
Liked: 1 time
Joined: Thu Jun 18, 2015 2:00 pm
Full Name: c82djau

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

Veeam Logoby v.Eremin » Fri Oct 16, 2015 9:40 am

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.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: quazer and 9 guests