PowerShell script exchange
Post Reply
ekisner
Expert
Posts: 203
Liked: 34 times
Joined: Jul 26, 2012 8:04 pm
Full Name: Erik Kisner
Contact:

Excluding Datastores from Backups

Post by ekisner »

Been poking aruond at this for a little while, and although I'm very close, my progress has dwindled down to a stand-still.

I want to add a simple exclusion, of all VMs in a datastore - specifically, by excluding the datastore. Please don't mind my nesting, I prefer it when writing on-the-fly commands, over scripts with variables.

Remove-VBRJobObject -Job (Get-VBRJob -name "My Backup Job") -Objects (Find-VBRViDatastore -server (Get-VBRServer -name "vCenter.domain.com") -name "Datastore to exclude")

Unfortunately, Find-VBRViDatastore returns a CViDatastoreItem value, where Remove-VBRJobObject requires a CObjectInJob value.

Anyone have some insight? I must need a different command to return a datastore as a CObjectInJob, but I can't seem to find one.
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Excluding Datastores from Backups

Post by ThomasMc »

You could have a butchers over this to get the answer

http://vpowercli.wordpress.com/2012/01/ ... -in-a-job/
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests