Different Powershell output styles

PowerShell script exchange

Different Powershell output styles

Veeam Logoby vbogda » Tue Dec 16, 2014 11:40 am

Hi,

The output from a script that loads the Veeam SnapIn is a bit different from the output you get from the PowerShell in the Veeam Backup & Replication main menu.
In particular, the SnapIn output appears to be a lot more verbose showing every property in the returned object while the bult-in Powershell renders its output in nicely formatted tables.

How can I get the output from my powershell scripts to be more like the one you get with the Powershell from the Veeam B&R menu?

Thanks
vbogda
Novice
 
Posts: 8
Liked: never
Joined: Thu Dec 11, 2014 2:19 pm
Full Name: Val Bogda

Re: Different Powershell output styles

Veeam Logoby nefes » Tue Dec 16, 2014 12:02 pm 1 person likes this post

You can use Format-List, Format-Table and similar commandlets to customize your output.
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Different Powershell output styles

Veeam Logoby vbogda » Tue Dec 16, 2014 12:22 pm

Nice, thanks. Obviously, Powershell scripting is new to me.

Would you know how to make Format-Table the default, say for a script? Sorry, my google foo has failed me.
vbogda
Novice
 
Posts: 8
Liked: never
Joined: Thu Dec 11, 2014 2:19 pm
Full Name: Val Bogda

Re: Different Powershell output styles

Veeam Logoby v.Eremin » Tue Dec 16, 2014 12:27 pm

Check this topicif you want to get output similar to the one you see when PS's executed via backup server GUI; should be helpful. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests