[英]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.