我目前正在尝试编写以下 Powershell 脚本,用 SharePoint 术语来说,它会检索管理中心 url(在 中检索$adminUrl
),然后使用该 url 打开一个 Internet Explorer 窗口。
$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
我在这里面临选角问题吗?