PowerShell script exchange
Post Reply
mfinnigan_g
Enthusiast
Posts: 33
Liked: 1 time
Joined: Jun 17, 2015 5:00 pm
Full Name: Matt Finnigan
Location: Boston, MA
Contact:

Documentation for objects and properties?

Post by mfinnigan_g »

I have a ticket open, and the next step for me was to turn off SAN snapshot integration on a bunch of jobs. Rather than spend a bunch of time clicking through several submenus, I wanted to do this in Powershell. This option isn't documented in the CLI reference. In fact, I don't seem to be able to find any documentation of object properties anywhere on the documentation site.

I was able to find this just now; it's in (get-vbrjob).options.sanintegrationoptions.UseSanSnapshots. Once I found the property name, I was able to search for it here on the forum and find other folks confirming that's the bit, but without knowing the property name next time I look for this, I'm just guessing.

Is there a single, preferably authoritative, document that contains all of the object properties that one can access with the VBR cmdlets? Microsoft Exchange is great about this and I'm spoiled. Bonus points if someone has mapped these properties to screenshots of the GUI, because things are not always called the same thing between the two interfaces.
tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Documentation for objects and properties?

Post by tdewin »

Well you can check this one:
https://github.com/VeeamHub/powershell/ ... Options.md

Although I need to update it to v9.5 (so some things might be different)
mfinnigan_g
Enthusiast
Posts: 33
Liked: 1 time
Joined: Jun 17, 2015 5:00 pm
Full Name: Matt Finnigan
Location: Boston, MA
Contact:

Re: Documentation for objects and properties?

Post by mfinnigan_g »

That's ... better than nothing, I guess, and quicker than me dumping every sub-property myself until I find something that looks like the right one.

It's not a substitute for proper (updated) documentation. I saw an example in another thread, that the compression level in the GUI is listed as descriptive words, but the Powershell takes integer values; those are least are documented in the get-help for Set-VBRJobAdvancedStorageOptions. Even worse, the "storage optimization" in the GUI is called "StgBlockSize" in Powershell, plus the fact that the values in the GUI are words, that don't have a documented relationship with the allowed KbBlockSize values.
mfinnigan_g
Enthusiast
Posts: 33
Liked: 1 time
Joined: Jun 17, 2015 5:00 pm
Full Name: Matt Finnigan
Location: Boston, MA
Contact:

Re: Documentation for objects and properties?

Post by mfinnigan_g »

Hm. Somehow I missed this page
https://helpcenter.veeam.com/docs/backu ... tml?ver=95

Which does document some of these things, but still doesn't translate between "local", "local 16+TB", etc and the KB block sizes.

And I do not see, either by fumbling around or in the search, where UseSanSnapshots is documented.
https://helpcenter.veeam.com/docs/backu ... nSnapshots returns no documents.
tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Documentation for objects and properties?

Post by tdewin »

Well for enums (like block storage), you can just use native powershell to discover the potential values. Eg (not veeam related),

If you want to know to possible values for DayOfWeek of a date object, you first execute a get-member on it

Code: Select all

C:\Users\timothy> (get-date).DayOfWeek | get-member
TypeName: System.DayOfWeek
...
It tells met that this is a System.DayOfWeek type

Now you can actually get the possible values by checking the class

Code: Select all

 C:\Users\timothy> [System.DayOfWeek] | get-member  -static -type property


   TypeName: System.DayOfWeek

Name      MemberType Definition
----      ---------- ----------
Friday    Property   static System.DayOfWeek Friday {get;}
Monday    Property   static System.DayOfWeek Monday {get;}
Saturday  Property   static System.DayOfWeek Saturday {get;}
Sunday    Property   static System.DayOfWeek Sunday {get;}
Thursday  Property   static System.DayOfWeek Thursday {get;}
Tuesday   Property   static System.DayOfWeek Tuesday {get;}
Wednesday Property   static System.DayOfWeek Wednesday {get;}
or directly with

Code: Select all

[System.Enum]::GetValues([System.DayOfWeek])
mfinnigan_g
Enthusiast
Posts: 33
Liked: 1 time
Joined: Jun 17, 2015 5:00 pm
Full Name: Matt Finnigan
Location: Boston, MA
Contact:

Re: Documentation for objects and properties?

Post by mfinnigan_g »

Those are good techniques; they go along great with good documentation.
ThierryF
Expert
Posts: 129
Liked: 34 times
Joined: Mar 31, 2018 10:20 am
Contact:

[MERGED] Powershell : object relationship map ?

Post by ThierryF »

Hello,

New in Veeam world, I am discovering Veeam powershell api and looking at a map that
shows how objects are linked together. Job, jobset, backup job and job members, ...

Do you have any useful info regarding that topic ?

Thanks !

Cheers

TH
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Documentation for objects and properties?

Post by veremin »

I'd recommend starting your automation journey with reviewing corresponding User Guide and then getting missing pieces with Get-Member cmdlet. Thanks.
markhensler
Service Provider
Posts: 44
Liked: 4 times
Joined: Mar 10, 2015 6:16 pm
Full Name: Mark Hensler
Contact:

[MERGED] Please improve the powershell documentation

Post by markhensler »

A year later, but I want to echo the concerns voiced in this thread: we need better documentation on objects and properties.

For an example, lets look at Veeam's documentation for Get-VBRJob. You already have sections for Applies To, Syntax, Parameters, and Examples. That's great. Then, at the top, you have a section titled "Short Description" under which the documentation merely says, "Returns existing jobs." I would rather see a section titled "Returns" which contains a link to the object(s) returned.

By comparison, let's look at Get-VM in VMware's CmdLet Reference. The cmdlet documentation includes a Return Type section with link to the VirtualMachine object documentation, which includes sections for Property Of, Parameter To, Returned By, Extends, and Properties.

Having detailed documentation available online like this is (for me) far easier to use and far quicker to find what I am looking for than sitting on a CLI and feeding objects through Get-Member.
Vek17
Service Provider
Posts: 49
Liked: 15 times
Joined: May 29, 2018 8:42 pm
Contact:

Re: Please improve the powershell documentation

Post by Vek17 »

Seconded. This would be especially useful when dealing with changes between patches as properties and functions on returned objects can change between patches.
Post Reply

Who is online

Users browsing this forum: aruns and 9 guests