Get-Content allsites.txt | where-object {$_ -match "kct_teamsite" -and $_ -match "kct/sites" } > teamsites.txt
get-content teamsites.txt | foreach-object {
$locURL = $_.indexof(' Url="http://')
$locOwner = $_.indexof(" Owner=")
$EndStr = $locOwner - $locURL
$TeamURL = $_.substring($locURL,$EndStr)
$TeamURL = $TeamURL -Replace ' Url="http://',''
$TeamURL = $TeamURL -Replace '"',''
$ie = new-object -comobject "InternetExplorer.Application"
$ie.visible = $true
$ie.navigate("$TeamURL")
Read-Host "Enter to continue"
}
I am getting the process working, to the point I get web page, minimized. Switch to page, make updates, close page, and go back to PowerShell and hit enter for next go around. From deafening silence I've got to assume what I thought I read was not related to having PowerShell wait for the IE close event before continuing. If there is a more elegant way of doing this, please let me know.
I did have some problems that I don't understand. I started off leaving the double quotes around the URL to preserve the blanks. What happened was the site would open as http://%22mysite/kct" and I would get site not found. Eliminating the quotes took care of the problem, but why did my leading quote get replaced by %22 and yet the trailing quote did not. It still does not work if I type it in, but at least both quotes are converted to %22.
IE doesn't open on top. Is there something in the framework that would move window to foreground?
Is there a way to start IE with a runas? I needed to bump permissions and was able to work around the issue by starting up IE manually with admin account and then all the new windows opened with the same permission. It just seems like a cleaner approach to have everything in the script.
Thanks for help and leading questions.
kct