{"id":1995,"date":"2015-06-12T17:36:15","date_gmt":"2015-06-12T15:36:15","guid":{"rendered":"http:\/\/www.itidea.nl\/?p=1995"},"modified":"2015-06-12T14:10:30","modified_gmt":"2015-06-12T12:10:30","slug":"quick-powershell-tips","status":"publish","type":"post","link":"https:\/\/www.itidea.nl\/index.php\/quick-powershell-tips\/","title":{"rendered":"Quick PowerShell Tips"},"content":{"rendered":"<h3 lang=\"nl\">Paste<\/h3>\n<p>In Command Prompt or PowerShell windows you can paste by right-clicking. But not always&#8230; Why?<br \/>\nRight-click the top bar and select properties.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Properties.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1998\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Properties-300x150.png\" alt=\"QPT Properties\" width=\"300\" height=\"150\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Properties-300x150.png 300w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Properties.png 463w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nSelect the Options tab and make sure the edit option &#8216;QuickEdit Mode&#8217; is selected. Now the right-click paste is working.<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Properties-QuickEdit-Mode.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1997 size-medium\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Properties-QuickEdit-Mode-243x300.png\" alt=\"QPT Properties QuickEdit Mode\" width=\"243\" height=\"300\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Properties-QuickEdit-Mode-243x300.png 243w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Properties-QuickEdit-Mode.png 386w\" sizes=\"auto, (max-width: 243px) 100vw, 243px\" \/><\/a><br \/>\nBesides the right-click paste you&#8217;re getting now, also the instant &#8216;Mark&#8217; is available. By left-clicking you can select text, press Enter or right-click and the selected text has been copied to the clipboard.<\/p>\n<p lang=\"nl\">This functionality isn&#8217;t new, but very neat!<\/p>\n<h3 lang=\"nl\">History<\/h3>\n<p>A known function is the up arrow key: with this command you can traverse through the commandline buffer and select one of the previous commands.<br \/>\nAnother option is the F7 key (Alt-F7 to clear the history). It shows a menu of previously run commands!<br \/>\n<a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-F7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1996\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-F7-300x192.png\" alt=\"QPT F7\" width=\"300\" height=\"192\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-F7-300x192.png 300w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-F7-600x384.png 600w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-F7.png 743w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This command history comes from the console-hosting application, not from PowerShell.<\/p>\n<p>PowerShell maintains it&#8217;s own history and can be seen bij executing the following command<br \/>\nGet-History | Select -ExpandProperty CommandLine<\/p>\n<p>When using the Get-History command and F7 in a SharePoint 2013 Management Shell you&#8217;ll notice the difference:<br \/>\nGet-History shows loading sharepoint.ps1 while the console history isn&#8217;t aware this command has even been executed.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Up-Arrow-key-vs-F71.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2007 size-full\" src=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Up-Arrow-key-vs-F71.png\" alt=\"QPT Up Arrow key vs F7\" width=\"668\" height=\"267\" srcset=\"https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Up-Arrow-key-vs-F71.png 668w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Up-Arrow-key-vs-F71-300x119.png 300w, https:\/\/www.itidea.nl\/wp-content\/uploads\/2015\/06\/QPT-Up-Arrow-key-vs-F71-600x239.png 600w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/a><\/p>\n<h3>Output history<\/h3>\n<p>A tip to store the previous run commands:<\/p>\n<p>Get-History | Select \u2013Expand CommandLine | Out-File savemycommands.ps1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Paste In Command Prompt or PowerShell windows you can paste by right-clicking. But not always&#8230; Why? Right-click the top bar and select properties. Select the Options tab and make sure the edit option &#8216;QuickEdit Mode&#8217; is selected. Now the right-click &#8230; <a class=\"more-link\" href=\"https:\/\/www.itidea.nl\/index.php\/quick-powershell-tips\/\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[43],"class_list":["post-1995","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-powershell"],"_links":{"self":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/comments?post=1995"}],"version-history":[{"count":11,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1995\/revisions"}],"predecessor-version":[{"id":2011,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1995\/revisions\/2011"}],"wp:attachment":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/media?parent=1995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/categories?post=1995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/tags?post=1995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}