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,但实际上它返回的是包含该成员的对象。感谢您的回答。 –