PowerShell script exchange
Post Reply
jftuga
Enthusiast
Posts: 26
Liked: 2 times
Joined: Oct 22, 2010 7:02 pm
Full Name: John Taylor
Location: Athens, GA
Contact:

powershell documentation

Post by jftuga » 1 person likes this post

Where might I find the powershell documentation for the "VeeamPSSnapin" snap-in for Backup & Replication 5.0.2 Enterprise. From the .chm help file, it suggests running "Get-VBRCommand" and "GetVBRToolkitDocumentation", but neither of these commands work for me: The term 'Get-VBRCommand' is not recognized as the name of a cmdlet, function, script file, or operable program.

After installing Veeam, I only see Start Menu -> Programs -> Veeam -> Veeam Backup and Replication. Since there is no icon for Veeam Powershell on the menu, I am unsure of the proper way to invoke a Veeam enabled shell. Therefore, I am starting a generic powershell on Server 2008 R2 and then typing in "Add-PSSnapin VeeamPSSnapin" as my first command. Get-VBRJob works as well as GetVBRJobOptions.

What I would really like is a PDF containing all of the commands, examples, etc. My end goal is to create about 30 new jobs with very specific settings. I believe this task will be much smoother, faster, and less error prone using powershell vs using the GUI.

Thanks,
-John

Gostev
SVP, Product Management
Posts: 26880
Liked: 4358 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: powershell documentation

Post by Gostev »

PDF you are looking for is the User Guide. Please refer to page 171 and onwards. This section provides both the information on how to obtain full documentation on all available PowerShell extensions, as well as some great examples. There are also many scripts posted on this forum by our users.

Note that PowerShell prompt with Veeam PowerShell snap-in already registered can be opened via Tools menu in the Veeam B&R console.

Thanks!

jftuga
Enthusiast
Posts: 26
Liked: 2 times
Joined: Oct 22, 2010 7:02 pm
Full Name: John Taylor
Location: Athens, GA
Contact:

Re: powershell documentation

Post by jftuga »

Thanks. This is exactly what I was looking for.

Is there anyway to launch the veeam enabled PS conole without having to start B&R first?

-John

Gostev
SVP, Product Management
Posts: 26880
Liked: 4358 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: powershell documentation

Post by Gostev »

Yes, and you have explained the way in your first post ;)

harsh.shah
Veeam ProPartner
Posts: 6
Liked: never
Joined: Feb 04, 2011 10:56 am
Full Name: Harsh Shah
Contact:

Re: powershell documentation

Post by harsh.shah »

Hi I am also facing the same problem. I have tried this and nothing works

foggy
Veeam Software
Posts: 19540
Liked: 1781 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: powershell documentation

Post by foggy »

Harsh, what exactly does not work for you? Were you managed to open a PowerShell prompt via Tools menu in the Veeam B&R UI or by starting a generic Windows PowerShell and executing "Add-PSSnapin VeeamPSSnapin" command?

Sethbartlett
Expert
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: powershell documentation

Post by Sethbartlett »

To do "Get-VBRCommand" outside of Veeam, you will want to do:

Code: Select all

asnp VeeamPSSnapin
get-command -pssnapin "VeeamPSSnapIn"
The asnp is to add the snapin, the get-command is "Get-VBRCommand". For some reason, get-vbrcommand was a function built within the .ps1 file that is loaded into Veeam and not a cmdlet instead, so use that and you can get a list of the commands outside of the Veeam console.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.

harsh.shah
Veeam ProPartner
Posts: 6
Liked: never
Joined: Feb 04, 2011 10:56 am
Full Name: Harsh Shah
Contact:

Re: powershell documentation

Post by harsh.shah »

I have fixed the issue now by adding the following

Code: Select all

if((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null){
    Add-PSSnapin "VeeamPSSnapIn"
}
Thanks

jftuga
Enthusiast
Posts: 26
Liked: 2 times
Joined: Oct 22, 2010 7:02 pm
Full Name: John Taylor
Location: Athens, GA
Contact:

Re: powershell documentation

Post by jftuga »

This is very helpful for me!

Thanks,
-John

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests