PowerShell script exchange
Post Reply
doslager
Novice
Posts: 6
Liked: 1 time
Joined: Nov 02, 2012 3:21 pm
Full Name: Dave O.
Contact:

VBR 6.5 - Cant register Powershell SnapIn

Post by doslager »

I am trying to use the powershell snapin and not having any luck.

This is a *clean* install of 6.5--not upgraded. I have installed it with the powershell option checked in the install process. For some reason the powershell snapin is not automatically registered. Also, this is a clean install of Windows 2008 R2 STD with all the patches up-to-date from MS. This is a new environment--it is all up to date. FWIW, the vCenter is 5.1 and ESXi hosts are 5.1 as well--but i havent got that far yet. :)

When i try to manually register the snapin, i get an error:

Code: Select all

PS C:\> Add-PSSnapin -name "VeeamPSSnapIn"
Add-PSSnapin : The Windows PowerShell snap-in 'VeeamPSSnapIn' is not installed on this machine.
At line:1 char:13
+ Add-PSSnapin <<<<  -name "VeeamPSSnapIn"
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapIn:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

PS C:\>
When i try to "add-type" to register the DLL (i think this is the correct process). I get an error:

Code: Select all

PS C:\>  Add-Type -path 'C:\Program Files\Veeam\Backup and Replication\Veeam.Backup.PowerShell.dll'
Add-Type : Could not load file or assembly 'file:///C:\Program Files\Veeam\Backup and Replication\Veeam.Backup.PowerShe
ll.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and can
not be loaded.
At line:1 char:10
+  Add-Type <<<<  -path 'C:\Program Files\Veeam\Backup and Replication\Veeam.Backup.PowerShell.dll'
    + CategoryInfo          : NotSpecified: (:) [Add-Type], BadImageFormatException
    + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.AddTypeCommand

PS C:\>
I have found some links suggesting that I change my powershell.exe.config file if the binary is created by .Net v4. But it does not seem to work either. I still cant add the DLL, nor the snapin.
http://tfl09.blogspot.com/2010/08/using ... -with.html
http://stackoverflow.com/questions/2094 ... -4-runtime

Did something change in 6.5 that requires a modification to powershell in order to register the DLL and then be able to Add-PSSnapIn?

Thanks!!

Dave O.
doslager
Novice
Posts: 6
Liked: 1 time
Joined: Nov 02, 2012 3:21 pm
Full Name: Dave O.
Contact:

Re: VBR 6.5 - Cant register Powershell SnapIn

Post by doslager » 1 person likes this post

FYI: It appears that the 6.5 PowerShell component does have something to do with .NET v4. I calledVeeam Support and they pointed me in the direction of this fix: Veeam Snap-in Problem

I installed the powershell component via the Install-VeeamToolkit.ps1 script in "C:\Program Files\Veeam\Backup and Replication". Ironically, i didnt see the aptly named script until i saw the above link.

Hope this helps someone else...

Thank you.
pjbryant
Novice
Posts: 9
Liked: never
Joined: Nov 05, 2012 10:58 am
Full Name: P J Bryant
Contact:

Re: VBR 6.5 - Cant register Powershell SnapIn

Post by pjbryant »

One further gotcha you might hit (just in case!)

If you have to create new .CONFIG files for powershell, remember to look for all powershell*.exe files in your powershell path and create any missing <exe name>.config files as per Thomas' advice in http://tfl09.blogspot.co.uk/2010/08/usi ... -with.html

On a machine i was working on powershell.exe.config existed, but the ISE exe was called powershell_ise.exe, had no .config file and therefore needed powershell_ise.exe.config to be created with the correct XML and not powershellise.exe.config

not been bothered to find out why the ISE EXE has a mildly different name, just fixed it :)
Post Reply

Who is online

Users browsing this forum: Max93 and 21 guests