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

Get online media

Post by joergr »

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
Veteran
Posts: 391
Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:

Re: Get online media

Post by joergr »

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: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get online media

Post by veremin » 1 person likes this post

What about using media location parameter?

Code: Select all

Get-VBRTapeMedium | where {$_.location -like "Drive"}
Thanks.
joergr
Veteran
Posts: 391
Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:

Re: Get online media

Post by joergr » 1 person likes this post

What a nice idea!!! ;-) Thanks Vladimir - that does it.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get online media

Post by veremin »

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 5 guests