PowerShell script exchange
Post Reply
TechO2
Lurker
Posts: 1
Liked: never
Joined: Dec 20, 2016 6:25 am
Full Name: Technicien O2 Informatique
Contact:

Problem when launching the command Get-VBRJob from powershell

Post by TechO2 »

Case 04056341

Hello,

I have a warning alert when the following command is launched in powershell : Get-VBRJob ( Powershell version 5.1.14 / OS : Windows Server 2016 / Veeam version : 10 / VeeamPSSnapin version : 5.1) :

"AVERTISSEMENT : This cmdlet is obsolete and no longer supported. To get computer backup job use "Get-VBRComputerbackupJob" instead"

However, when I test it with other OS (please see below), there is no warning message. Do you know why this message is appeared, please ? Thanks in advance.

Tests
- Powershell v5.1.17 / Windows Server 2019 / Veeam version 9.5 / VeeamPSSnapin version : 5.1 ==> Without warning message
- Powershell v5.1.17 / Windows Server 2019 / Veeam version 10 / VeeamPSSnapin version : 5.1 ==> Without warning message
- Powershell v5.1.1' / Windows Server 2016 / Veeam version 10 / VeeamPSSnapin version : 5.1 ==> With warning message
- Powershell v4.0 / Windows Server 2012R2 / Veeam version 10 / VeeamPSSnapin version : 4.0 ==> Without warning message

veremin
Product Manager
Posts: 17745
Liked: 1612 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Problem when launching the command Get-VBRJob from powershell

Post by veremin » 2 people like this post

We've implemented a different cmdlet that returns computer backup policy - Get-VBRComputerBackupJob. In order not to break existing scripts and warn users that in the next releases cmdlet will not return computer backup job, we've added the corresponding warning.

However, current wording seems a bit misleading and leads to certain confusion - so, we will fix it in the Update 1.

Had to say why it pop us only on certain environments, though, you might want to continue investigating it with the support team.

However, if you simply want to skip the warning, use WarningAction parameter with "SilentlyContinue" value.

Thanks!

MaxKozlov
Influencer
Posts: 19
Liked: 5 times
Joined: Oct 26, 2017 12:52 pm
Full Name: Max Kozlov
Contact:

Re: Problem when launching the command Get-VBRJob from powershell

Post by MaxKozlov »

Want to menthion that new cmdlets doesn't have some features that have old.
for example
now I can

Code: Select all

(Get-VBRJob 'MyAgentJob').FindlLastSession()
to quickly get last session of the job
and with

Code: Select all

Get-VBRComputerBackupJobSession
I get all sessions which i should sort and select for the same task

I hope such things will be implemented in future

veremin
Product Manager
Posts: 17745
Liked: 1612 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Problem when launching the command Get-VBRJob from powershell

Post by veremin » 1 person likes this post

We're moving away from having dynamic methods inside PS classes (not recommended practice). However, having a simple switch for Get-VBRComputerBackupJobSession that returns last session only (say, -Last or something) sounds like a good idea. So, thank you for the suggestion. Thanks!

oleg.feoktistov
Veeam Software
Posts: 391
Liked: 125 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Problem when launching the command Get-VBRJob from powershell

Post by oleg.feoktistov »

Agree with you, guys! Such switch is also already implemented for Get-VBRSession. So, makes sense to unify it further. Added as a feature request for both Get-VBRBackupSession and Get-VBRComputerBackupJobSession. Thanks!

MaxKozlov
Influencer
Posts: 19
Liked: 5 times
Joined: Oct 26, 2017 12:52 pm
Full Name: Max Kozlov
Contact:

Re: Problem when launching the command Get-VBRJob from powershell

Post by MaxKozlov »

veremin wrote:
May 28, 2020 3:59 pm
We're moving away from having dynamic methods inside PS classes (not recommended practice).
So, let me list methods that I use so future cmdlets do not lost this rich functionality

Code: Select all

$backoup.FindChildBackups()
$backup.GetLastOibs()
$backup.GetLastPoint()
$backup.FindParentJob()
$backup.GetOibsByOriginalIdInBackup()
$job.GetLastBackup()
$job.FindLastSession()
$session.Logger.GetLog().UpdatedRecords.Title
$oib.GetSourceJob()

oleg.feoktistov
Veeam Software
Posts: 391
Liked: 125 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Problem when launching the command Get-VBRJob from powershell

Post by oleg.feoktistov » 1 person likes this post

I'll keep an eye on your use case and see if we can implement such logic for other .NET methods or find any alternatives in the future. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests