top of page

PowerShell Script to get list of links on a webpage

Note that you can run a PowerShell script to get a list of all of the hyperlinks on a web page. On any PC running Windows 10, open PowerShell ISE, and simply put this script:


(Invoke-WebRequest -Uri “https://www.supremecourt.gov/opinions/slipopinion/20”).Links | sort-object href -Unique | Format-List innerText, href


. . . in the Script Pane, the white area on the top. (Display this area under the View menu, if you don't see it after opening PowerShell.) The actual web address, as you can see, is entered after '-Uri' in double quotes.


So from this web page:


. . . we get these results after pressing the play button on the toolbar in PowerShell.





Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page