[英]Why does my PowerShell Search Not Return Any Results From My DLNA Server?
我正在尝试使用 PowerShell 在我的 DLNA 设备中搜索视频列表。 我的代码是:
InvokeAction 执行成功,但不返回任何数据。
if ($service.Id -like "*ContentDirectory*")
{
$objectID="0"
$browseFlag= "upnp:class='object.item.videoItem.movie'"
$filter = ""
$startingIndex = 0
$requestedCount = 0
$sortCriteria=""
$myInObject = @($objectID, $browseFlag, $filter, $startingIndex, $requestedCount, $sortCriteria)
$result=""
$numberReturned=0
$totalMatches=0
$updateId=0
$outArgs = @($result, $numberReturned, $totalMatches, $updateId)
$response = $service.InvokeAction("Search", $myInObject, [ref]$outArgs)
Write-Host $outArgs[0]
Write-Host $outArgs[1]
Write-Host $outArgs[2]
Write-Host $outArgs[3]
}
谁能向我解释我的代码有什么问题? 我想知道这是否是 $browseFlag 变量的格式,但我已经尝试了我能想到的每一种单引号和双引号的组合,但它们都不起作用。
通常情况下,我在发布问题后不久就偶然发现了答案。
我所做的只是改变
$outArgs = @($result, $numberReturned, $totalMatches, $updateId)
至
$outArgs = $null
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.