PowerShell script exchange
Post Reply
RogerH
Influencer
Posts: 15
Liked: 2 times
Joined: May 08, 2009 1:04 pm
Full Name: Roger Hungerbuehler
Contact:

$_. Variables?

Post by RogerH »

Hi

I've allready searched the forum, the powershell reference and the online help as well, but without any luck so far :)
So, can someone please tell me, where i can find a complete list of all the $_. variables tha area available for Veeam powershell?

Thanks
Roger
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: $_. Variables?

Post by veremin » 3 people like this post

Hi, Roger.

The variables of different type have different parameters; so, there is no universal approach in this case. The best idea to list all properties/methods of a given variable is to use Get-Member methods. For instance, let’s bind a backup job called “Backup Job 1” to variable $Job and see what parameters it contains:

Code: Select all

asnp VeeamPSSnapin 
$Job = Get-VBRJob -name "Backup Job 2"
$Job | Get-Member 
As the result, you will see the following list:

Code: Select all

Name                         MemberType Definition                                                                                
----                         ---------- ----------                                                                                
CanRunByScheduler            Method     bool ISchedulableJob.CanRunByScheduler()                                                  
Delete                       Method     void Delete()                                                                             
DisableScheduler             Method     void DisableScheduler()                                                                   
EnableScheduler              Method     void EnableScheduler()                                                                    
Equals                       Method     bool Equals(System.Object obj)                                                            
FindInitialRepository        Method     Veeam.Backup.Core.CBackupRepository FindInitialRepository()                               
FindLastSession              Method     Veeam.Backup.Core.CBackupSession FindLastSession(), Veeam.Backup.Model.CBaseSessionInfo...
FindSourceWanAccelerator     Method     Veeam.Backup.Core.CWanAccelerator FindSourceWanAccelerator()                              
FindTargetRepository         Method     Veeam.Backup.Core.CBackupRepository FindTargetRepository()                                
FindTargetWanAccelerator     Method     Veeam.Backup.Core.CWanAccelerator FindTargetWanAccelerator()                              
GetDiskEffectiveCompression  Method     int GetDiskEffectiveCompression()                                                         
GetFilesEffectiveCompression Method     int GetFilesEffectiveCompression()                                                        
GetHashCode                  Method     int GetHashCode()                                                                         
GetHvOijs                    Method     Veeam.Backup.Core.HyperV.CHvOij[] GetHvOijs()                                             
GetInitialRepository         Method     Veeam.Backup.Core.CBackupRepository GetInitialRepository()                                
GetLastResult                Method     Veeam.Backup.Model.CBaseSessionInfo+EResult GetLastResult(), Veeam.Backup.Model.CBaseSe...
GetLastState                 Method     Veeam.Backup.Model.CBaseSessionInfo+EState GetLastState(), Veeam.Backup.Model.CBaseSess...
GetObjectsInJob              Method     Veeam.Backup.Core.CObjectInJob[] GetObjectsInJob()                                        
GetOptions                   Method     Veeam.Backup.Model.CJobOptions GetOptions()                                               
GetProxy                     Method     System.Collections.Generic.IEnumerable[Veeam.Backup.Core.IProxy] GetProxy()               
GetScheduleOptions           Method     Veeam.Backup.Model.ScheduleOptions GetScheduleOptions()                                   
GetSourceOffHostHvProxies    Method     Veeam.Backup.Core.CHvProxy[] GetSourceOffHostHvProxies()                                  
GetSourceViProxies           Method     Veeam.Backup.Core.CViProxy[] GetSourceViProxies()                                         
GetSourceWanAccelerator      Method     Veeam.Backup.Core.CWanAccelerator GetSourceWanAccelerator()                               
GetTargetHost                Method     Veeam.Backup.Core.CHost GetTargetHost()                                                   
GetTargetOffhostHvProxies    Method     Veeam.Backup.Core.CHvProxy[] GetTargetOffhostHvProxies()                                  
GetTargetProxies             Method     System.Collections.Generic.IEnumerable[Veeam.Backup.Core.IProxy] GetTargetProxies()       
GetTargetRepository          Method     Veeam.Backup.Core.CBackupRepository GetTargetRepository()                                 
GetTargetViProxies           Method     Veeam.Backup.Core.CViProxy[] GetTargetViProxies()                                         
GetTargetWanAccelerator      Method     Veeam.Backup.Core.CWanAccelerator GetTargetWanAccelerator()                               
GetType                      Method     type GetType()                                                                            
GetVcdOijs                   Method     Veeam.Backup.Core.CObjectInJob[] GetVcdOijs()                                             
GetViOijs                    Method     Veeam.Backup.Core.CObjectInJob[] GetViOijs()                                              
GetVssOptions                Method     Veeam.Backup.Model.CVssOptions GetVssOptions()                                            
IsFileCopy                   Method     bool IsFileCopy()                                                                         
IsInBackupWindow             Method     bool IsInBackupWindow(datetime now)                                                       
IsStopped                    Method     bool IsStopped()                                                                          
IsWanAcceleratorEnabled      Method     bool IsWanAcceleratorEnabled()                                                            
LogHvProxySettings           Method     void LogHvProxySettings()                                                                 
LogJobOptions                Method     void LogJobOptions(Veeam.Backup.Model.CDbBackupJobInfo+Mode mode)                         
LogJobSession                Method     void LogJobSession(Veeam.Backup.Core.CBackupSession jobSession, Veeam.Backup.Core.IBack...
Reload                       Method     void Reload()                                                                             
ResetScheduleDependentJobs   Method     void ResetScheduleDependentJobs(Veeam.Backup.Core.CBackupJob parentJob)                   
SetLatestRecheck             Method     void SetLatestRecheck(datetime dateTime)                                                  
SetOptions                   Method     void SetOptions(Veeam.Backup.Model.CJobOptions jobOptions)                                
SetScheduleDependentJobs     Method     void SetScheduleDependentJobs(Veeam.Backup.Core.CBackupJob job)                           
SetVssOptions                Method     void SetVssOptions(Veeam.Backup.Model.CVssOptions vssOptions)                             
SureMoveObj                  Method     void SureMoveObj(guid objectId, Veeam.Backup.Model.CDbObjectInJobInfo+EType sourceType,...
SureObjAdded                 Method     void SureObjAdded(guid objectId, Veeam.Backup.Model.CDbObjectInJobInfo+EType enType)      
ToString                     Method     string ToString()                                                                         
AutoScheduleOptions          Property   Veeam.Backup.Model.CAutoScheduleOptions AutoScheduleOptions {get;}                        
BackupPlatform               Property   Veeam.Backup.Common.EPlatform BackupPlatform {get;}                                       
BackupStorageOptions         Property   Veeam.Backup.Model.CDomBackupStorageOptions BackupStorageOptions {get;}                   
BackupTargetOptions          Property   Veeam.Backup.Model.CDomBackupTargetOptions BackupTargetOptions {get;}                     
Description                  Property   string Description {get;}                                                                 
HvReplicaTargetOptions       Property   Veeam.Backup.Model.CDomHvReplicaTargetOptions HvReplicaTargetOptions {get;}               
HvSourceOptions              Property   Veeam.Backup.Model.CDomHvSourceOptions HvSourceOptions {get;}                             
Id                           Property   guid Id {get;}                                                                            
Info                         Property   Veeam.Backup.Model.CDbBackupJobInfo Info {get;}                                           
IsBackup                     Property   bool IsBackup {get;}                                                                      
IsBackupSync                 Property   bool IsBackupSync {get;}                                                                  
IsContinuous                 Property   bool IsContinuous {get;}                                                                  
IsFileTapeBackup             Property   bool IsFileTapeBackup {get;}                                                              
IsFree                       Property   bool IsFree {get;}                                                                        
IsInitialReplica             Property   bool IsInitialReplica {get;}                                                              
IsLegacyReplica              Property   bool IsLegacyReplica {get;}                                                               
IsMappingReplica             Property   bool IsMappingReplica {get;}                                                              
IsRemoteSnapshotReplica      Property   bool IsRemoteSnapshotReplica {get;}                                                       
IsReplica                    Property   bool IsReplica {get;}                                                                     
IsScheduleEnabled            Property   bool IsScheduleEnabled {get;}                                                             
IsSnapshotReplica            Property   bool IsSnapshotReplica {get;}                                                             
IsTapeBackup                 Property   bool IsTapeBackup {get;}                                                                  
IsVmCopy                     Property   bool IsVmCopy {get;}                                                                      
IsVmTapeBackup               Property   bool IsVmTapeBackup {get;}                                                                
JobOptions                   Property   Veeam.Backup.Model.CDomJobOptions JobOptions {get;}                                       
JobTargetType                Property   Veeam.Backup.Model.EDbJobType JobTargetType {get;}                                        
JobType                      Property   Veeam.Backup.Model.EDbJobType JobType {get;}                                              
Name                         Property   string Name {get;}                                                                        
NotificationOptions          Property   Veeam.Backup.Model.CDomNotificationOptions NotificationOptions {get;}                     
Options                      Property   Veeam.Backup.Model.CJobOptions Options {get;}                                             
PostJobCommand               Property   Veeam.Backup.Model.CDomPostJobCommand PostJobCommand {get;}                               
PreviousJobIdInScheduleChain Property   System.Nullable[guid] PreviousJobIdInScheduleChain {get;}                                 
ScheduleOptions              Property   Veeam.Backup.Model.ScheduleOptions ScheduleOptions {get;}                                 
SourceProxyAutoDetect        Property   bool SourceProxyAutoDetect {get;}                                                         
SourceType                   Property   Veeam.Backup.Model.CDbBackupJobInfo+ESourceType SourceType {get;}                         
TargetDir                    Property   string TargetDir {get;}                                                                   
TargetFile                   Property   string TargetFile {get;}                                                                  
TargetHostId                 Property   guid TargetHostId {get;}                                                                  
TargetType                   Property   Veeam.Backup.Model.CDbBackupJobInfo+ETargetType TargetType {get;}                         
TypeToString                 Property   string TypeToString {get;}                                                                
ViReplicaTargetOptions       Property   Veeam.Backup.Model.CDomViReplicaTargetOptions ViReplicaTargetOptions {get;}               
ViSourceOptions              Property   Veeam.Backup.Model.CDomViSourceOptions ViSourceOptions {get;}                             
VssOptions                   Property   Veeam.Backup.Model.CVssOptions VssOptions {get;}                                      

The same procedure can be applied to the other variables

Hope this helps.
Thanks.
RogerH
Influencer
Posts: 15
Liked: 2 times
Joined: May 08, 2009 1:04 pm
Full Name: Roger Hungerbuehler
Contact:

Re: $_. Variables?

Post by RogerH »

Hi Vladimir

This is exactly what i was looking for :-)
Thank you for the (very) quick answer and the detailed instructions.
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: $_. Variables?

Post by veremin »

You’re welcome. Feel free to ask, should any additional questions arise. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests