PowerShell script exchange
joergr
Veteran
Posts: 391 Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:
Post
by joergr » Nov 10, 2014 7:07 pm
this post
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:
Post
by joergr » Nov 10, 2014 8:14 pm
this post
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:
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
Veteran
Posts: 391 Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:
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: 20415 Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Nov 11, 2014 9:14 am
this post
You're welcome. By the way, I've moved the topic to the corresponding subforum and renamed it for the convenience of future readers.
Users browsing this forum: No registered users and 5 guests