$_.CompleteName
2つの属性を$_.Channel
ランダムに見つけるにはどうすればよいですか?
+ $channel | ? {$liste} | get-random <<<< -min 0 -max $liste.list.groupe.count
+ CategoryInfo : InvalidArgument: (position:PSObject) [Get-Random
], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Command
s.GetRandomCommand
サンプルデータ
$Xliste = [xml]@"
<list>
<groupe>
<position type="General">
<CompleteName>folder-1</CompleteName>
<dateYY>2014</dateYY>
<dateMM>jaenner</dateMM>
<dateDD>mittwoch</dateDD>
<Overall_mode>cbr</Overall_mode>
<Duration>00:1:27</Duration>
<Overall_rate>96.0Kbps</Overall_rate>
</position>
<position type="Version">
<Channel>channel2</Channel>
<CodecID>55</CodecID>
<Duration>00:1:27</Duration>
<Compression>Lossy</Compression>
<StreamSize>96.0Kbps</StreamSize>
</position>
</groupe>
<groupe>
<position type="General">
<CompleteName>folder-2</CompleteName>
<dateYY>2013</dateYY>
<dateMM>maerz</dateMM>
<dateDD>montag</dateDD>
<Overall_mode>cbr</Overall_mode>
<Duration>00:8:12</Duration>
<Overall_rate>96.0Kbps</Overall_rate>
</position>
<position type="Version">
<Channel>channel1</Channel>
<CodecID>49</CodecID>
<Duration>00:8:12</Duration>
<Compression>Lossy</Compression>
<StreamSize>96.0Kbps</StreamSize>
</position>
</groupe>
</list>
"@
コード
$channel_and_CompleteName = Select-Xml $liste -xpath "*/*/*" | Select-Object -Expand node | ? {$_ -ne ($_.CompleteName)+" "+($_.Channel)}
$channel_and_CompleteName | ? {$liste} | get-random -min 0 -max $liste.list.groupe.count