PowerShell script exchange
Post Reply
tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Dump of (unsupported) Properties and Methods

Post by tdewin » 1 person likes this post

At Veeamhub we just created a script to make dumps of properties and methods of objects return by cmdlets. Notice that using these might be unsupported (especially the methods). A dump is also uploaded so you don't explicitly have to run the script (although you could if you are on another version). They might not be complete as well since the dump is done versus a real instance of the object.

https://github.com/VeeamHub/powershell/ ... -VBRObject

For example for all options returned by get-vbrjoboptions, check
https://github.com/VeeamHub/powershell/ ... Options.md

Ok so you found your attribute.

Code: Select all

$VBRJobOptions.GenerationPolicy.RetentionPolicyType [Veeam.Backup.Model.ERetentionPolicyType]
The value between the square brackets is the type. Most custom types are enums. You can find the required value by doing

Code: Select all

[Veeam.Backup.Model.ERetentionPolicyType] | gm -static -MemberType Properties
Or you can just add "::" and tab to autocomplete and select your value

Code: Select all

[Veeam.Backup.Model.ERetentionPolicyType]::
After a tab, you might get

Code: Select all

[Veeam.Backup.Model.ERetentionPolicyType]::GFS
Enjoy!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests