PowerShell script exchange
Post Reply
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Get-VBRJob getlaststate method

Post by pizzim13 »

Are there states other than "Working" and Stopped" for a backup job when using Get-VBRJob's getlaststate method?
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get-VBRJob getlaststate method

Post by ThomasMc »

Starting->Working->Stopping->Stopped is the ones I've seen
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Re: Get-VBRJob getlaststate method

Post by pizzim13 »

I am looking for the ones you don't normally see (if they even exist). There could have been an "Initializing" state that came and went before you ran get-vbrjob or there could be a set of errors states.
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get-VBRJob getlaststate method

Post by ThomasMc »

I kicked off the job from powershell and right after that stuck it in a loop

Code: Select all

$a = Get-VBRJob | ?{$_.Name -eq "JobName" }

do {
	Add-Content "c:\output.txt" $a.GetLastState()
} while ( $a.GetLastState() -ne "Stopped" )
http://dl.dropbox.com/u/4304771/state.txt

if there are any more then they must be hard to catch as you can see by my state.txt
Sethbartlett
Veteran
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Get-VBRJob getlaststate method

Post by Sethbartlett »

As always Peter :D

Code: Select all

public enum EState
    {
      Stopped = -1,
      Starting = 3,
      Stopping = 4,
      Working = 5,
      Pausing = 6,
      Resuming = 7,
    }
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.
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get-VBRJob getlaststate method

Post by ThomasMc »

So are you going to tell us how to pause the jobs then :D
Gostev
Chief Product Officer
Posts: 31814
Liked: 7302 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Get-VBRJob getlaststate method

Post by Gostev »

Needless to say I am surprised myself :)
Sethbartlett
Veteran
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Get-VBRJob getlaststate method

Post by Sethbartlett »

Probably placed in there for possibilities, but pausing would just be all sorts of bad with snapshots :D
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.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests