V8 changes

PowerShell script exchange

V8 changes

Veeam Logoby McClane » Tue Nov 11, 2014 7:44 am

Hi,

I am testing out the new version and saw some changes to the powershell commandlets.
The get-vbrtapemedium returns the location of the tape in the library, but it only says "Slot" without any number now. In the gui the correct number is displayed.
Documenatation says it should return the slot ID, as in V7.

Greetings,

Manuel
McClane
Enthusiast
 
Posts: 91
Liked: 10 times
Joined: Sat Jun 20, 2009 12:47 pm

Re: V8 changes

Veeam Logoby v.Eremin » Tue Nov 11, 2014 9:04 am

Hi, Manuel,

Please, try the following script and see whether it meets your expectations:

Code: Select all
Get-VBRTapeMedium | where {$_.location -like "Slot"} | select name, {$_.Location.SlotAddress}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 changes

Veeam Logoby McClane » Tue Nov 11, 2014 9:27 am 1 person likes this post

Works like a charm. Thanks.
McClane
Enthusiast
 
Posts: 91
Liked: 10 times
Joined: Sat Jun 20, 2009 12:47 pm

Re: V8 changes

Veeam Logoby v.Eremin » Tue Nov 11, 2014 9:32 am

You're welcome. Should other questions arise, don't hesitate to reach us.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 changes

Veeam Logoby willn » Tue Nov 11, 2014 4:39 pm

So, I was using the method isoverwriteprotectionperiodover() in one of my scripts for the same get-vbrtapemedium cmdlet and now that has been taken out with v8.

Is there an alternative to this method in v8?
willn
Influencer
 
Posts: 15
Liked: never
Joined: Mon May 07, 2012 1:47 pm
Full Name: William Nelson

Re: V8 changes

Veeam Logoby v.Eremin » Wed Nov 12, 2014 9:35 am

Can you query .expirationdate parameter, instead? Something like:

Code: Select all
$Medium.ExpirationDate -eq (Get-Date)


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 changes

Veeam Logoby v.Eremin » Wed Nov 12, 2014 10:51 am

I believe you can also use IsExpired parameter. Just make sure to discard free mediums. The following script, for instance, lists all non-free, unexpired tapes:

Code: Select all
Get-VBRTapeMedium | ?{($_.isfree -eq $false) -and ($_.IsExpired -eq $false)


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 changes

Veeam Logoby willn » Wed Nov 12, 2014 7:24 pm

Thanks Eremin, I believe this will work for these purposes, but there are other methods you guys have removed regarding tapes and cmdlets. Is there a reason for taking these out?
willn
Influencer
 
Posts: 15
Liked: never
Joined: Mon May 07, 2012 1:47 pm
Full Name: William Nelson

Re: V8 changes

Veeam Logoby v.Eremin » Thu Nov 13, 2014 7:47 am

You're right, the PowerShell tape mode has been restructured. We've done it mostly due to previous model missing options and having multiple design shortcomings. Like, it was not possible to change most of backup to tape job, file to tape job, media pool settings, etc.

It required major design reconsideration, indeed, but we tried to preserve compatibility and provide alternatives for replaced methods and parameters.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 2 guests