PowerShell script exchange
Post Reply
vbogda
Novice
Posts: 8
Liked: never
Joined: Dec 11, 2014 2:19 pm
Full Name: Val Bogda
Contact:

Different Powershell output styles

Post by vbogda »

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
nefes
Veeam Software
Posts: 643
Liked: 162 times
Joined: Dec 10, 2012 8:44 am
Full Name: Nikita Efes
Contact:

Re: Different Powershell output styles

Post by nefes » 1 person likes this post

You can use Format-List, Format-Table and similar commandlets to customize your output.
vbogda
Novice
Posts: 8
Liked: never
Joined: Dec 11, 2014 2:19 pm
Full Name: Val Bogda
Contact:

Re: Different Powershell output styles

Post by vbogda »

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.
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Different Powershell output styles

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests