{"id":5004,"date":"2012-09-08T00:01:00","date_gmt":"2012-09-08T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2012\/09\/08\/weekend-scripter-exploring-new-and-improved-powershell-3-0-cmdlets\/"},"modified":"2012-09-08T00:01:00","modified_gmt":"2012-09-08T00:01:00","slug":"weekend-scripter-exploring-new-and-improved-powershell-3-0-cmdlets","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/weekend-scripter-exploring-new-and-improved-powershell-3-0-cmdlets\/","title":{"rendered":"Weekend Scripter: Exploring New and Improved PowerShell 3.0 Cmdlets"},"content":{"rendered":"<p align=\"left\"><b>Summary<\/b>: Microsoft Scripting Guy, Ed Wilson, goes spelunking for new and improved Windows PowerShell&nbsp;3.0 cmdlets.<\/p>\n<p align=\"left\">Microsoft Scripting Guy, Ed Wilson, is here. Today is officially the last day of my vacation. Tomorrow, early in the morning, I hop on a plane and head to Redmond, Washington for a week of meetings. This is not a bad thing because I will get to see many really cool people from the Windows PowerShell team. For a Scripting Guy, this will seem more like vacation than work. The only bad thing is that I get back right before <a href=\"http:\/\/www.eventbrite.com\/event\/3863822798?ref=ebtnebregn\" target=\"_blank\">Windows PowerShell Saturday in Charlotte<\/a>.<\/p>\n<h2 align=\"left\">Playing around with Get-Help to find new and improved cmdlets<\/h2>\n<p align=\"left\">I love playing around with Windows PowerShell&nbsp;3.0. On weekends and when I am traveling, I open the Windows PowerShell console and begin to explore. I always return to the three most basic cmdlets when I am exploring. The three basic cmdlets I use are <b>Get-Help<\/b>, <b>Get-Command<\/b>, and <b>Get-Member<\/b>. A fourth one I always use is the <b>Where-Object<\/b> cmdlet.<\/p>\n<p align=\"left\">Today, I decided to play around with <b>Get-Help<\/b> and see where Windows PowerShell&nbsp;3.0 was specifically mentioned. I decided to do the search because I remembered seeing some cmdlets being mentioned as introduced in Windows PowerShell 3.0. Here is the command I used.<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">Get-Command -CommandType cmdlet | Foreach-Object { get-help $_ } |<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">select name, description | where description -match &#8220;powershell 3.0&#8221;<\/p>\n<p align=\"left\">In this command (which is a single line command that I broke at the pipe character), I first use <b>Get-Command<\/b> to return only cmdlets. I pipe the returned cmdlet info objects to the <b>Foreach-Object<\/b> cmdlet and use <b>Get-Help<\/b> to obtain Help from the cmdlets. Next, I use the <b>Select-Object<\/b> cmdlet, and I choose the name and description where the description matches PowerShell 3.0.<\/p>\n<p align=\"left\">The output was a bit difficult to read, so I decided to autosize the output and wrap the lines. To do this, I use the <b>Format-Table<\/b> cmdlet as shown here.<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">Get-Command -CommandType cmdlet | Foreach-Object { get-help $_ } |<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">select name, description | where description -match &#8220;powershell 3.0&#8221; | Format-Table -AutoSize -Wrap<\/p>\n<p align=\"left\">Now that I have something I can read, I noticed that the Help uses the same types of language all the time when introducing a new Windows PowerShell 3.0 cmdlet or when announcing a modification to a previously existing cmdlet. Here is the text that introduces new functionality for an existing cmdlet.<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">Beginning in Windows PowerShell 3.0<\/p>\n<p align=\"left\">Here is the text that introduces a new cmdlet.<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">This cmdlet is introduced in Windows PowerShell 3.0<\/p>\n<p align=\"left\"><b>Note<\/b> &nbsp;&nbsp;Today I am talking about exploring Windows PowerShell 3.0 via <b>Get-Help<\/b> and associated cmdlets. I am not writing a complete document that details all the changes in Windows PowerShell&nbsp;3.0.<\/p>\n<p align=\"left\">I then begin to explore. First, I look for modified cmdlets by using the command shown here (this command is a single command that I broke on the pipe characters for readability).<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">Get-Command -CommandType cmdlet | Foreach-Object { get-help $_ } |<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">select name, description |<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">where description -match &#8220;Beginning in Windows PowerShell 3.0&#8221; |<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">format-table -AutoSize &ndash;Wrap<\/p>\n<p align=\"left\">The command and its associated output are shown here.<\/p>\n<p align=\"left\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0083.HSG-9-8-12-01.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0083.HSG-9-8-12-01.png\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p align=\"left\">Next, I look for new cmdlets. Here is the command I used.<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">Get-Command -CommandType cmdlet | Foreach-Object { get-help $_ } |<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">select name, description |<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">where description -match &#8220;This cmdlet is introduced in Windows PowerShell 3.0&#8221; |<\/p>\n<p align=\"left\" style=\"padding-left: 30px\">Format-Table -AutoSize &ndash;Wrap<\/p>\n<p align=\"left\">The command and its associated output are shown in the image that follows.<\/p>\n<p align=\"left\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1526.HSG-9-8-12-02.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1526.HSG-9-8-12-02.png\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p align=\"left\">Hopefully this will get you started playing around with Windows PowerShell&nbsp;3.0 It comes installed on Windows 8 and Windows Server 2012. For more information about downloading it on Windows 7, Windows Server 2008, and Windows Server 2008 R2, see <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2012\/09\/06\/powershell-3-0-is-now-available-for-download.aspx\" target=\"_blank\">PowerShell 3.0 Is Now Available for Download!<\/a> &nbsp;<\/p>\n<p align=\"left\">I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p align=\"left\"><b>Ed Wilson, Microsoft Scripting Guy<\/b>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, goes spelunking for new and improved Windows PowerShell&nbsp;3.0 cmdlets. Microsoft Scripting Guy, Ed Wilson, is here. Today is officially the last day of my vacation. Tomorrow, early in the morning, I hop on a plane and head to Redmond, Washington for a week of meetings. This is not a [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[364,3,61,45],"class_list":["post-5004","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-powershell-3-0","tag-scripting-guy","tag-weekend-scripter","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, goes spelunking for new and improved Windows PowerShell&nbsp;3.0 cmdlets. Microsoft Scripting Guy, Ed Wilson, is here. Today is officially the last day of my vacation. Tomorrow, early in the morning, I hop on a plane and head to Redmond, Washington for a week of meetings. This is not a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/5004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=5004"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/5004\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=5004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=5004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=5004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}