February 13th, 2013

PowerTip: Use PowerShell 3.0 Cmdlet to Find PowerTips and Links

Doctor Scripto
Scripter

Summary: Use a Windows PowerShell 3.0 cmdlet to find PowerTip articles and the associated links.

Hey, Scripting Guy! Question How can I use a Windows PowerShell 3.0 cmdlet to find PowerTip articles and associated links to those articles?

Hey, Scripting Guy! Answer Use the Invoke-WebRequest cmdlet and specify the URI for the Hey, Scripting Guy! Blog. Use the links property and match the word “PowerTip” that starts the title for each PowerTip article. Finally, select the innertext and the href properties, as shown here.

$hsg = Invoke-WebRequest -Uri http://www.scriptingguys.com/blog

$hsg.Links | ? innertext -match ‘^Powertip’ | select innertext, href

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.