{"id":1297,"date":"2013-03-29T16:07:23","date_gmt":"2013-03-29T16:07:23","guid":{"rendered":"https:\/\/pipe2text.com\/?page_id=1297"},"modified":"2013-04-02T02:31:32","modified_gmt":"2013-04-02T02:31:32","slug":"using-the-show-command-cmdlet-in-powershell-3-0","status":"publish","type":"page","link":"https:\/\/pipe2text.com\/?page_id=1297","title":{"rendered":"Using the Show-Command cmdlet in PowerShell 3.0"},"content":{"rendered":"<p>Hi All,<\/p>\n<p>A useful cmdlet that was introduced in PowerShell 3.0 is the show-command. This can be used for quickly generating a command in PowerShell and is a great learning tool.<\/p>\n<p>First thing you can do to get started is simply open PowerShell and type \u201cshow-command\u201d and press enter. You will see a GUI interface opens up with a list of cmdlets and an option to choose from different modules as shown below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"width: 688px; height: 558px; display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/show-command\/image1.png\" width=\"688\" height=\"632\" \/><\/p>\n<p>In this example I will be choosing the \u201cSend-MailMessage\u201d to demonstrate the usefulness of the \u201cShow-Command\u201d cmdlet. Type in \u201cSend\u201d in the \u201cName\u201d box and choose the \u201cSend-MailMessage\u201d cmdlet and you will see a list of parameters show up as shown below.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/show-command\/image2.png\" \/><\/p>\n<p>Fill in the parameters as necessary to complete your command as shown in the next illustration.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/show-command\/image3.png\" \/><\/p>\n<p>When you are finished\u00a0filling in all the information you need you can either click the \u201cRun\u201d or you can click \u201ccopy\u201d. If you click the &#8220;Run&#8221; button\u00a0it will copy the command to the PowerShell window and immediately run it as shown below. In this example the code would execute and an email message that would be sent from <a href=\"mailto:BC@pipe2text.com\">BC@pipe2text.com<\/a> to <a href=\"mailto:JA@pipe2text.com\">JA@pipe2text.com<\/a> with a subject of \u201cShow-Command is really cool\u201d and a body stating \u201cThis is a good learning tool!\u201d The message would be sent using the SMTP server smtp.pipe2text.com.<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/show-command\/image4.png\" \/><\/p>\n<p>If you click \u201ccopy\u2019 you can then paste the code somewhere else for review it, manipulate it or to add to a script etc\u2026<\/p>\n<p><img decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/show-command\/image5.png\" \/><\/p>\n<p>As you can see from the example above, this really can be used as an excellent learning tool or a way to put together a quick PowerShell command. The above is just one example of using the \u201cShow-Command\u201d cmdlet to create commands for another cmdlet. Depending on the cmdlet you choose the options will differ.<\/p>\n<p>I hope this helps and have fun! As always, if you have any questions or feedback, please a comment.<a id=\"_GoBack\"><\/a><\/p>\n<p>Related Links:<\/p>\n<p><strong><a title=\"Getting Started with PowerShell 2.0\" href=\"https:\/\/pipe2text.com\/?page_id=71\">Getting Started With PowerShell 2.0<\/a><\/strong><\/p>\n<p><strong><a title=\"Recording the Commands and Output of a PowerShell Session to a text file in PowerShell 2.0\" href=\"https:\/\/pipe2text.com\/?page_id=622\">Recording the Commands and Output of a PowerShell Session to a text file in PowerShell 2.0<\/a><\/strong><\/p>\n<p><a title=\"Using the Server Manager Module in PowerShell to Install Roles and Features On a Windows Server\" href=\"https:\/\/pipe2text.com\/?page_id=1366\"><strong>Using the Server Manager Module in PowerShell to Install Roles and Features On a Windows Server<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, A useful cmdlet that was introduced in PowerShell 3.0 is the show-command. This can be used for quickly generating a command in PowerShell and is a great learning tool. First thing you can do to get started is &hellip; <a href=\"https:\/\/pipe2text.com\/?page_id=1297\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"class_list":["post-1297","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1297"}],"version-history":[{"count":11,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1297\/revisions"}],"predecessor-version":[{"id":1304,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1297\/revisions\/1304"}],"wp:attachment":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}