【发布时间】:2012-07-03 18:55:08
【问题描述】:
我目前正在尝试编写以下 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
我在这里遇到选角问题吗?
【问题讨论】:
标签: sharepoint powershell