Select-MusicSource.ps1
function Select-MusicSource { [CmdletBinding(DefaultParameterSetName="MusicSource")] param( [Parameter(ParameterSetName="MusicSource")] [Int]$Source = 1, [Parameter(ParameterSetName="GameAudio")] [switch]$GameAudio ) Send-Xbox -XBox -Wait "0:0:2" Send-Xbox -DPadRight -Wait "0:0:1" foreach ($n in 1..5) { Send-Xbox -DPadDown } Send-Xbox -A -Wait "0:0:5" if ($GameAudio) { Send-Xbox -X -Wait "0:0:1" Send-Xbox -XBox } else { for ($n =1; $n -lt $source;$n++) { Send-Xbox -DPadDown } Send-Xbox -A } } |