PowerShell script exchange
timgowen
Influencer
Posts: 21 Liked: never
Joined: Aug 22, 2017 8:34 am
Full Name: Tim Gowen
Contact:
Post
by timgowen » Jun 24, 2020 3:27 pm
this post
I am trying to get a list of Tapes and the detail for each tape - Membership of GFS Set would be ideal.
This from the forum:
Code: Select all
asnp VeeamPSSnapin
Get-VBRTapeMedium | Select-Object -Property @{N="Tape Name";E={$_.name}}, @{N="Barcode";E={$_.Barcode}}, @{N="Media Set";E={$_.MediaFamilyItem.GetMediaFamily().name}},@{N="Media Pool";E={$_.FindMediaPool().name}}
Gives me a blank Media Set and Media Pool
Tape Name Barcode Media Set Media Pool
--------- ------- --------- ----------
000242L8 000242L8
000139L6 000139L6
And I can't work out why...
oleg.feoktistov
Veeam Software
Posts: 2010 Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:
Post
by oleg.feoktistov » Jun 25, 2020 2:38 pm
this post
Hi Tim,
That's because MediaFamilyItem property and GetMediaFamily()/FindMediaPool() dynamic methods are no longer implemented in VBRTapeMedium PS type.
The good news is that you can use relevant properties instead:
Code: Select all
Get-VBRTapeMedium | Select-Object -Property @{n="Tape Name";e={$_.name}}, Barcode, @{n="Media Set";e={$_.MediaSet}}, @{n="Media Pool";e={$_.MediaPoolId}}
If you want to retrieve media pool name specifically, the other way around is:
Code: Select all
$medium = Get-VBRTapeMedium
$mediumFiltered = @()
foreach ($media in $medium) {
$poolId = $media.MediaPoolId
$pool = Get-VBRTapeMediaPool -Id $poolId
$mediumFiltered += $media | select @{n='Tape Name';e={$_.Name}}, Barcode, @{n='Media Set';e={$_.MediaSet}}, @{n='Media Pool';e={$pool.Name}}
}
Best regards,
Oleg
Users browsing this forum: No registered users and 7 guests