I have a PowerShell script which will open an instance of internet explorer, go to a certain website and find a hidden link but when I go to that link it redirects me to another page.
I'd like to find the URL of the page that internet explorer is now in to be stored in a variable.
Thanks!
For those who only read code:
$IE = new-object -com internetexplorer.application
$IE.visible = $true
$Document = $IE.navigate2("example.com")
# Do stuff
$Document = $IE.navigate2($LinkIFound)
# It redirects me...
# TODO: Find URL of page I am now in.
So if you are trying to get the current location of a document then you can use :
$IE.Document.url