-
- Service Provider
- Posts: 880
- Liked: 164 times
- Joined: Aug 26, 2013 7:46 am
- Full Name: Bastiaan van Haastrecht
- Location: The Netherlands
- Contact:
Getting last lape session status
Hi,
From v8 the session status of a tape job has moved to Get-VBRSession. However this new CMDlet lacks the functions we had like LastState, LastResult, LastSession ext. They are now fetchable by arguments.
Why o why is there a difference in approach in getting session information from a 'normal' job and a tape job? This make's programming unlogical... I need to make an version chech to make the script complaint against multiple versions... grrr.
Regards,
Bastiaan
From v8 the session status of a tape job has moved to Get-VBRSession. However this new CMDlet lacks the functions we had like LastState, LastResult, LastSession ext. They are now fetchable by arguments.
Why o why is there a difference in approach in getting session information from a 'normal' job and a tape job? This make's programming unlogical... I need to make an version chech to make the script complaint against multiple versions... grrr.
Regards,
Bastiaan
======================================================
Veeam ProPartner, Service Provider and a proud Veeam Legend
Veeam ProPartner, Service Provider and a proud Veeam Legend
-
- Product Manager
- Posts: 20411
- Liked: 2300 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Getting last lape session status
I'm not quite following you on that.
The said cmdlet returns VBRBackupSession object that has Result and State properties. Those contain the information you're looking for.
Thanks.
The said cmdlet returns VBRBackupSession object that has Result and State properties. Those contain the information you're looking for.
Thanks.
-
- Product Manager
- Posts: 20411
- Liked: 2300 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Getting last lape session status
A tape job entity also has LastState and LastResult parameters that can be used in this case. Thanks.
-
- Service Provider
- Posts: 880
- Liked: 164 times
- Joined: Aug 26, 2013 7:46 am
- Full Name: Bastiaan van Haastrecht
- Location: The Netherlands
- Contact:
Re: Getting last lape session status
$job=(Get-VBRJob -name $job_name)
$tapejob=(Get-VBRTapeJob -name $job_name)
$job.GetLastResult
$job.GetLastState
$tapejob.LastResult
$tapejob.LastState
And
$job_session=$job.FindLastSession(); #FindLastSession is not there on tape jobs
$tape_session = Get-VBRSession -Job $tapejob -Last #need to do it like this
It works offcourse, but one and the same approach for all job type's is preferabele.
The name Get-VBRSession is misleading, it's only for tape jobs so why Veeam didn't name it Get-VBRTapeSession is
$tapejob=(Get-VBRTapeJob -name $job_name)
$job.GetLastResult
$job.GetLastState
$tapejob.LastResult
$tapejob.LastState
And
$job_session=$job.FindLastSession(); #FindLastSession is not there on tape jobs
$tape_session = Get-VBRSession -Job $tapejob -Last #need to do it like this
It works offcourse, but one and the same approach for all job type's is preferabele.
The name Get-VBRSession is misleading, it's only for tape jobs so why Veeam didn't name it Get-VBRTapeSession is
======================================================
Veeam ProPartner, Service Provider and a proud Veeam Legend
Veeam ProPartner, Service Provider and a proud Veeam Legend
-
- Product Manager
- Posts: 20411
- Liked: 2300 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Getting last lape session status
GetLastResult() is dynamic method, while LastResult is static property. Thus, the difference.
While working on PS model for tape functionality, we decided to stick to MS best practices that recommend avoiding usage of dynamic methods on PS objects.
As Get-VBRSession commandlet, we're planning to expand it further in order for it to include sessions of types different than tape one.
Thanks.
While working on PS model for tape functionality, we decided to stick to MS best practices that recommend avoiding usage of dynamic methods on PS objects.
As Get-VBRSession commandlet, we're planning to expand it further in order for it to include sessions of types different than tape one.
Thanks.
-
- Service Provider
- Posts: 880
- Liked: 164 times
- Joined: Aug 26, 2013 7:46 am
- Full Name: Bastiaan van Haastrecht
- Location: The Netherlands
- Contact:
Re: Getting last lape session status
Would be very nice if the Get-VBRSession would scope all job types.
And a free tip, work with deprecated warnings with one version in between so we have some time to adjust our scripts accordingly.
And a free tip, work with deprecated warnings with one version in between so we have some time to adjust our scripts accordingly.
======================================================
Veeam ProPartner, Service Provider and a proud Veeam Legend
Veeam ProPartner, Service Provider and a proud Veeam Legend
-
- Product Manager
- Posts: 20411
- Liked: 2300 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Getting last lape session status
We already try to follow the suggested practice at least with commandlets.
However, the internal properties and methods change inside product db with every product version. And it's not possible to preserve two versions in this case.
Anyway, thank you for the feedback; appreciated.
However, the internal properties and methods change inside product db with every product version. And it's not possible to preserve two versions in this case.
Anyway, thank you for the feedback; appreciated.
Who is online
Users browsing this forum: No registered users and 8 guests