0
我目前正在嘗試編寫以下Powershell腳本,其中以SharePoint術語檢索管理中心URL(在$adminUrl
中檢索),然後使用該URL打開Internet Explorer窗口。將Powershell對象作爲字符串參數傳遞
我還追加另一個字符串$adminUrl
將它傳遞給Navigate
方法之前:
$adminUrl = Get-spwebapplication -includecentraladministration | where {$_.DisplayName -eq "SharePoint Central Administration v4"} | select Url
$ie = New-Object -ComObject InternetExplorer.Application
$ie.Navigate($adminUrl + "/someurl") # <= Trying to pass the url here
$ie.Visible = $true
但試圖這樣做時,我得到這個異常:
Cannot find an overload for "Navigate" and the argument count: "1".
At \\a\setup.ps1:9 char:1
+ $ie.Navigate($adminUrl)
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
上午我在這裏面臨鑄造問題?
+1非常好,那就是我一直在尋找的。我以爲用select可以直接返回url,但實際上它返回的是包含該成員的對象。感謝您的回答。 –