{"id":144,"date":"2010-03-26T21:16:56","date_gmt":"2010-03-26T10:16:56","guid":{"rendered":"http:\/\/chuchuva.com\/pavel\/?p=144"},"modified":"2010-03-26T17:10:32","modified_gmt":"2010-03-26T06:10:32","slug":"enhancement-to-launching-powershell-scripts-from-far-manager","status":"publish","type":"post","link":"https:\/\/chuchuva.com\/pavel\/2010\/03\/enhancement-to-launching-powershell-scripts-from-far-manager\/","title":{"rendered":"Enhancement to launching PowerShell scripts from Far Manager"},"content":{"rendered":"<p>The method of <a href=\"http:\/\/chuchuva.com\/pavel\/2009\/08\/how-to-run-powershell-scripts-from-far-manager\/\">launching PowerShell scripts from Far Manager<\/a> I have described previously has 2 important drawbacks:<\/p>\n<ol>\n<li>You can&#8217;t pass arguments to the script, and<\/li>\n<li>You can&#8217;t launch script in a separate window<\/li>\n<\/ol>\n<p>Here&#8217;s how to fix this:<\/p>\n<ol>\n<li>Start regedit, open HKCR\\Microsoft.PowerShellScript.1\\shell\\Open\\command key<\/li>\n<li>Set it to<br \/>\n<code>\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-file\" \"%1\" %*<\/code><\/li>\n<\/ol>\n<p>Now you can press Shift+Enter to start PowerShell script in a new window.<\/p>\n<p>As a bonus, you can now double-click .ps1 files in Windows Explorer to launch them. Why is this not a default behaviour? Most likely Microsoft decided to be extra cautious here.<\/p>\n<p>Make sure you have Powershell version 2.0 or higher for this to work. <a href=\"http:\/\/powershell.com\/cs\/blogs\/tips\/archive\/2009\/09\/11\/which-powershell-version-am-i-running.aspx\">How to check Powershell version<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The method of launching PowerShell scripts from Far Manager I have described previously has 2 important drawbacks: You can&#8217;t pass arguments to the script, and You can&#8217;t launch script in a separate window Here&#8217;s how to fix this: Start regedit, open HKCR\\Microsoft.PowerShellScript.1\\shell\\Open\\command key Set it to &#8220;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe&#8221; &#8220;-file&#8221; &#8220;%1&#8221; %* Now you can press Shift+Enter &hellip; <a href=\"https:\/\/chuchuva.com\/pavel\/2010\/03\/enhancement-to-launching-powershell-scripts-from-far-manager\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Enhancement to launching PowerShell scripts from Far Manager<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[9,10],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-software","tag-far-manager","tag-powershell"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":0,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"wp:attachment":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}