PowerShell script exchange
Post Reply
McClane
Expert
Posts: 106
Liked: 11 times
Joined: Jun 20, 2009 12:47 pm
Contact:

V8 changes

Post by McClane »

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
veremin
Product Manager
Posts: 20411
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: V8 changes

Post by veremin »

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.
McClane
Expert
Posts: 106
Liked: 11 times
Joined: Jun 20, 2009 12:47 pm
Contact:

Re: V8 changes

Post by McClane » 1 person likes this post

Works like a charm. Thanks.
veremin
Product Manager
Posts: 20411
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: V8 changes

Post by veremin »

You're welcome. Should other questions arise, don't hesitate to reach us.
willn
Influencer
Posts: 15
Liked: never
Joined: May 07, 2012 1:47 pm
Full Name: William Nelson
Contact:

Re: V8 changes

Post by willn »

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?
veremin
Product Manager
Posts: 20411
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: V8 changes

Post by veremin »

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

Code: Select all

$Medium.ExpirationDate -eq (Get-Date)
Thanks.
veremin
Product Manager
Posts: 20411
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: V8 changes

Post by veremin »

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.
willn
Influencer
Posts: 15
Liked: never
Joined: May 07, 2012 1:47 pm
Full Name: William Nelson
Contact:

Re: V8 changes

Post by willn »

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?
veremin
Product Manager
Posts: 20411
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: V8 changes

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests