PowerShell script exchange
Post Reply
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

READ THIS FIRST: [FAQ][Powershell] FREQUENTLY ASKED QUESTIONS (Powershell edition)

Post by oleg.feoktistov » 8 people like this post

Last updated: August, 2023

Where can I find an article on .NET methods, classes and properties ?

There isn't one. We don't support them, so we don't describe them in the User Guide.

How can I tell if I use unsupported code ?

It contains any of the below:
  • Static methods

    Code: Select all

    [Veeam.Backup.Core.CBackup]::GetAll()
    
  • Dynamic methods

    Code: Select all

    $job = Get-VBRJob -Name 'Backup Job 1' # supported part
    $job.FindLastSession()  # unsupported part
    
  • Internal classes (usually have C* prefix, or E* for enumerations)

    Code: Select all

    $job = Get-VBRJob -Name 'Backup Job 1' # supported part
    $job.Info  # unsupported part, internal class
    PS C:\Users\Administrator> $job.Info.GetType()
    
    IsPublic IsSerial Name                                     BaseType                                    
    -------- -------- ----                                     --------                                    
    True     True     CDbBackupJobInfo                         System.Object     
    
How can I tell if I use supported code ?

It contains cmdlets and types described in the User Guide. Some of the powershell types are not there, so the general rule is - if you see a powershell type with VBR prefix, then it's supported (unless it's a type used in an internal cmdlet, see the next point). Most of these types reside in Veeam.Backup.Powershell.Infos namespace or in Veeam.<DatabaseType>.Powershell.Models if they are related to Explorers. Example:

Code: Select all

$repo = Get-VBRObjectStorageRepository
PS C:\Users\Administrator> $repo.GetType() | select FullName

FullName                                            
--------                                            
Veeam.Backup.PowerShell.Infos.VBRAzureBlobRepository
What if I found a cmdlet that works but is not mentioned in the User Guide ?

Then there is a 99% chance you have encountered an internal cmdlet used for debugging or autotests. It is not supported and can cause an unexpected behavior.

What about the official cmdlets that still work with internal classes ?

They are supported and described in the guide, but the output relies on internal classes, so it may vary from release to release because of changes introduced in the business logic. We support such classes on a best effort basis until we have new powershell types created for them. Some of them are still described in the User Guide, which makes it an exception.

If a new cmdlet that doesn't operate with internal classes is available for the same feature/subset of features, use it instead.

Example:

Use Get-VBRComputerBackupJob instead of Get-VBRJob for agent management backup jobs.

If another cmdlet that doesn't require setting class properties through .NET reflections exists for the same feature/subset of features, use it instead.

Example:

Use Set-VBRJobSchedule instead of a conjunction of New-VBRJobScheduleOptions and Set-VBRJobScheduleOptions.

What do I do if I need help with unsupported methods and classes ?

Post your question on forums. We can help you with changed method signatures, properties, errors etc. on a best effort basis. Don't submit a support case unless the issue is with an official cmdlet or a type. If you do, you will still be redirected here.

See you on forums,
Oleg
albertwt
Veteran
Posts: 880
Liked: 47 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: READ THIS FIRST: [FAQ][Powershell] FREQUENTLY ASKED QUESTIONS (Powershell edition)

Post by albertwt »

Thank you, @Oleg, for sharing and explaining this topic. I appreciate your patience and willingness to help me understand the concept better.
--
/* Veeam software enthusiast user & supporter ! */
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests