PowerTip: Use PowerShell 3.0 Cmdlet to Find PowerTips and Links

Doctor Scripto

Dr Scripto

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

0 comments

Comments are closed.