Dump of (unsupported) Properties and Methods

PowerShell script exchange

Dump of (unsupported) Properties and Methods

Veeam Logoby tdewin » Fri Dec 02, 2016 11:38 am 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!
tdewin
Veeam Software
 
Posts: 1110
Liked: 391 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Return to PowerShell



Who is online

Users browsing this forum: Google [Bot] and 1 guest