PowerShell script exchange
Post Reply
joergr
Expert
Posts: 386
Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:

Get online media

Post by joergr » Nov 10, 2014 7:07 pm

Hi,

with V8 the tape scripting has lightly changed. When using V7 you can read the tapes online at THIS time (i want to know the medium which is IN the tape now) with

Code: Select all

get-vbrtapemedium | Where-Object {$_.IsOnline -like "True"}
With V8 the result returns empty, because the Object "IsOnline" is gone with V8. Any Ideas how to accomplish this task?

Workaround: I need a command to erase everything it finds in the tape drives at the time the command is issued.

Best regards,
Joerg

joergr
Expert
Posts: 386
Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:

Re: Get online media

Post by joergr » Nov 10, 2014 8:14 pm

Come on, there *has* to be a more elegant way like such thing here:

Code: Select all

$drives = get-vbrtapedrive
foreach ($drive_id in $drives)
{
$medium = get-vbrtapemedium -drive $drive_id
Erase-VBRTapeMedium -Medium $medium -confirm:$false   
}
so *please* think with me ;-)

Best regards,
Joerg
+

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

Re: Get online media

Post by veremin » Nov 11, 2014 8:47 am 1 person likes this post

What about using media location parameter?

Code: Select all

Get-VBRTapeMedium | where {$_.location -like "Drive"}
Thanks.

joergr
Expert
Posts: 386
Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:

Re: Get online media

Post by joergr » Nov 11, 2014 9:07 am 1 person likes this post

What a nice idea!!! ;-) Thanks Vladimir - that does it.

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

Re: Get online media

Post by veremin » Nov 11, 2014 9:14 am

You're welcome. By the way, I've moved the topic to the corresponding subforum and renamed it for the convenience of future readers.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests