0

#PSTip Get PowerShell Magazine’s daily tips right from your console!

Our editors at the PowerShell Magazine are doing a great job pushing daily PowerShell tips and tricks to our readers. Now, wouldn’t it be great if you can get access to these tips right from your console?

Yes, it is easy. In fact, PowerShell 3.0 makes it way too easy. Check this:

Function Get-PSTip {
	param (
		[switch]$Multiple
	)

	$url = Invoke-RestMethod -Uri "http://bit.ly/QwjgRd"

	if ($Multiple) {
		$selectedTips = $url | Select-Object Title, Link | Out-GridView -PassThru
		if ($selectedTips) {
			$selectedTips | Foreach-Object {
				Start-Process $_.Link
			}
		}
	} else {
		Start-Process $url[0].Link
	}
}

This is it. Add this simple code snippet to your PowerShell profile and then every time you run, Get-PSTip, you will have the latest tip served right from your console or PowerShell ISE prompt. Also, you can use Get-PSTip with -Multiple parameter to select a tip from the list and open that in browser.

Filed in: Columns, Tips and Tricks Tags: , , ,

Leave a Reply

Submit Comment

© 2016 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.
%d bloggers like this: