-
- Enthusiast
- Posts: 26
- Liked: 2 times
- Joined: Oct 22, 2010 7:02 pm
- Full Name: John Taylor
- Location: Athens, GA
- Contact:
powershell documentation
Where is the documentation for the powershell api? I want to create about 25 different jobs -- the only differences being the server that is getting backed up and the target directory. I figured it would be quicker to do this through PS rather than the GUI.
Also, any examples on how to do this would be greatly appreciated!
Thanks,
-John
Also, any examples on how to do this would be greatly appreciated!
Thanks,
-John
-
- Enthusiast
- Posts: 26
- Liked: 2 times
- Joined: Oct 22, 2010 7:02 pm
- Full Name: John Taylor
- Location: Athens, GA
- Contact:
Re: powershell documentation
OK, I found the PS documentation in the User Guide. I am still not sure where to start. I have Server 2008 R2 w/ PS version 2. I start powershell from the Start Menu, but none of the Get-VBR cmdlets seem to work. It says the command is not recognized as the name of cmdlet, function, or script file. Is there some special way that PS needs to be invoked in order for these cmdlets to work?
Thanks,
-John
Thanks,
-John
-
- Enthusiast
- Posts: 26
- Liked: 2 times
- Joined: Oct 22, 2010 7:02 pm
- Full Name: John Taylor
- Location: Athens, GA
- Contact:
Re: powershell documentation
OK, I just found out how to get this working. Within Veeam, Tools -> PowerShell. One more question, however. If I wanted to start a Veeam PS script from a batch file (that periodically ran from Task Scheduler), how would I invoke the PS script from within the batch file itself?
-
- Influencer
- Posts: 13
- Liked: 19 times
- Joined: Jan 01, 2006 1:01 am
- Contact:
-
- Enthusiast
- Posts: 26
- Liked: 2 times
- Joined: Oct 22, 2010 7:02 pm
- Full Name: John Taylor
- Location: Athens, GA
- Contact:
Re: powershell documentation
Hi Paul,
Please post something actually useful. For example, *which* PS script to run from the batch file. When you access the PS prompt from the GUI, it is unclear which PS script is invoked to get the Veeam cmdlets loaded. This is not mentioned in the User Guide either.
-John
Please post something actually useful. For example, *which* PS script to run from the batch file. When you access the PS prompt from the GUI, it is unclear which PS script is invoked to get the Veeam cmdlets loaded. This is not mentioned in the User Guide either.
-John
-
- VP, Product Management
- Posts: 27377
- Liked: 2800 times
- Joined: Mar 30, 2009 9:13 am
- Full Name: Vitaliy Safarov
- Contact:
Re: powershell documentation
John, the syntax is fairly simple.
First of all you should add the line below to your_script.ps1. Please note that you should add this before executing any commands, as this line should register Veeam Snap-in in Powershell:
Then use Windows Scheduler to trigger you batch file, which will contain the line below:
Hope it helps!
First of all you should add the line below to your_script.ps1. Please note that you should add this before executing any commands, as this line should register Veeam Snap-in in Powershell:
Code: Select all
Add-PSSnapin VeeamPSSnapIn
Code: Select all
powershell.exe .\Your_script.ps1
-
- Chief Product Officer
- Posts: 31814
- Liked: 7302 times
- Joined: Jan 01, 2006 1:01 am
- Location: Baar, Switzerland
- Contact:
Re: powershell documentation
To be fair to Paul, he did answer the exact question that you have asked, so it is hard to call his response "not useful".jftuga wrote:Please post something actually useful.
The one you wanted to run according to your 3rd post above? I don't understand this question...jftuga wrote:For example, *which* PS script to run from the batch file.
What do you mean? There is no script invoked when you open PS prompt - it is just a command prompt. Just like there is no script invoked when you open regular command prompt with cmd.exe - it is there for you to type in and execute the commands.jftuga wrote:When you access the PS prompt from the GUI, it is unclear which PS script is invoked to get the Veeam cmdlets loaded.
Loading Veeam cmdlet with the above command just adds "namespace" to your script (or PS prompt session for that matter), so that you can start calling Veeam PS commands in it.
Well, you really need to be looking at the PowerShell documentation for this kind of information, not at our VBR User Guide. Basically, we assume that anyone who wants to create PowerShell scripts with our extensions will have basic understanding of PowerShell.jftuga wrote:This is not mentioned in the User Guide either.
-
- Enthusiast
- Posts: 26
- Liked: 2 times
- Joined: Oct 22, 2010 7:02 pm
- Full Name: John Taylor
- Location: Athens, GA
- Contact:
Re: powershell documentation
This is how you pull up the Exchange Mgmt Shell:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'"
So I thought there was a ps1 file that needed to be loaded. My apologies for the confusion on my part.
-John
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'"
So I thought there was a ps1 file that needed to be loaded. My apologies for the confusion on my part.
-John
Who is online
Users browsing this forum: No registered users and 6 guests