PowerShell script exchange
Post Reply
johannesk
Expert
Posts: 148
Liked: 32 times
Joined: Jan 19, 2016 1:28 pm
Full Name: Jóhannes Karl Karlsson
Contact:

Simple output from Start-VBRQuickBackup

Post by johannesk »

Hi,

I letting my users us a script to do a Start-VBRQuickBackup. The only problem I have with it is that the output in the end showes to much information. I only need it to state the result

Result : Failed

but not the whole attributes like:
.
.
WillBeRetried
IsManuallyStopped
IsTransformLaunched
LastProgressSaveTime
.
.
and so on.

I'm a beginner PS user, so please bear with me if this is just something very simple. The code I'm using is plain and simple.

$vm_to_backup = Find-VBRViEntity -Server $vcenter -Name $vm
Start-VBRQuickBackup -VM $vm_to_backup -Wait

How can I get a simple output from the script that just tells my users if the backup was successful or not?

Regards,
Jóhannes
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Simple output from Start-VBRQuickBackup

Post by jhoughes » 1 person likes this post

Add this to the end of your Start-VBRQuickBackup line:

Code: Select all

| Select-Object Result
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
johannesk
Expert
Posts: 148
Liked: 32 times
Joined: Jan 19, 2016 1:28 pm
Full Name: Jóhannes Karl Karlsson
Contact:

Re: Simple output from Start-VBRQuickBackup

Post by johannesk »

Thanks Joe, exactly what I needed.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests