Hello there,
Suppose you have a text file "url.txt" located in c:\temp and that each line in the file corresponds to a url you want to open with IE. Then the code below would open each url in the file.
$textfile = "c:\temp\url.txt"
ForEach ($url in Get-Content $textfile) {
$IE=new-object -com internetexplorer.application
$IE.navigate2($url)
$IE.visible=$true
}
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer--
Script powershell ouverture de multiple URL depuis un excel
solosikoa
0
Reputation points
Bonjour tous le monde,
Est t'il possible de faire un script PowerShell qui ouvre différent URL puis les ferme depuis un fichier Excel ?
Windows for business | Windows Server | User experience | PowerShell
2 answers
Sort by: Most helpful
-
Limitless Technology 45,021 Reputation points
2023-04-27T15:03:03.1366667+00:00 -
Rich Matheisen 47,951 Reputation points
2023-04-27T15:19:59.4233333+00:00 If you're working with Excel spreadsheets you should install the ImportExcel module. It makes coding much simpler.
You haven't stated what information you need from the target URL so the code below just saves the web page(s) in an array.
Here's an example that does what you asked:
[array]$x = @() Import-Excel C:\junk\urls.xlsx | ForEach-Object{ $x += Invoke-WebRequest $_.URL -UseBasicParsing }Here's a sample spreadsheet: