I am currently trying to write the following Powershell script which, in SharePoint terms, retrieves the Central Administration url (retrieved in $adminUrl) and then opens an Internet Explorer window with that url.
I'm also appending another string to $adminUrl before passing it to the Navigate method:
$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
But I'm getting this exception when trying to do so:
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
Am I facing a casting issue here?