{"id":34,"date":"2009-08-05T20:27:21","date_gmt":"2009-08-05T10:27:21","guid":{"rendered":"http:\/\/chuchuva.com\/pavel\/?p=34"},"modified":"2011-05-04T03:19:10","modified_gmt":"2011-05-03T17:19:10","slug":"how-to-run-powershell-scripts-from-far-manager","status":"publish","type":"post","link":"https:\/\/chuchuva.com\/pavel\/2009\/08\/how-to-run-powershell-scripts-from-far-manager\/","title":{"rendered":"How to run PowerShell scripts from Far Manager"},"content":{"rendered":"<p>Let&#8217;s say you use Far Manager and want to launch PowerShell script. With default installation pressing Enter on PowerShell script in Far Manager will open the script in Notepad. Not very helpful.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"35\" data-permalink=\"https:\/\/chuchuva.com\/pavel\/2009\/08\/how-to-run-powershell-scripts-from-far-manager\/notepad\/\" data-orig-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/C%3A%5CHostingSpaces%5CPavel%5Cchuchuva.com%5Cwwwroot%5Cpavel\/images\/2009\/08\/notepad.png?fit=274%2C143&amp;ssl=1\" data-orig-size=\"274,143\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"notepad\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/C%3A%5CHostingSpaces%5CPavel%5Cchuchuva.com%5Cwwwroot%5Cpavel\/images\/2009\/08\/notepad.png?fit=274%2C143&amp;ssl=1\" class=\"alignnone size-full wp-image-35\" src=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/wp-content\/uploads\/2009\/08\/notepad.png?resize=274%2C143\" alt=\"\" width=\"274\" height=\"143\" \/><\/p>\n<p>Here&#8217;s how to configure Far Manager to launch PowerShell script by pressing Enter key:<\/p>\n<ol>\n<li>Open Commands menu, select File associations.<\/li>\n<li>Press Ins key to add new association.<\/li>\n<li>Enter *.ps1 as file mask.<\/li>\n<li>Enter the following as execute command:\n<pre>powershell.exe -file \"!.!\"<\/pre>\n<\/li>\n<\/ol>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"37\" data-permalink=\"https:\/\/chuchuva.com\/pavel\/2009\/08\/how-to-run-powershell-scripts-from-far-manager\/file-association\/\" data-orig-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/C%3A%5CHostingSpaces%5CPavel%5Cchuchuva.com%5Cwwwroot%5Cpavel\/images\/2009\/08\/file-association.gif?fit=498%2C232&amp;ssl=1\" data-orig-size=\"498,232\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"file-association\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/C%3A%5CHostingSpaces%5CPavel%5Cchuchuva.com%5Cwwwroot%5Cpavel\/images\/2009\/08\/file-association.gif?fit=498%2C232&amp;ssl=1\" class=\"alignnone size-full wp-image-37\" src=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/wp-content\/uploads\/2009\/08\/file-association.gif?resize=498%2C232\" alt=\"\" width=\"498\" height=\"232\" \/><\/p>\n<p>Bonus: how to change colour of PowerShell scripts to green:<\/p>\n<ol>\n<li>Open Options menu, select Files highlighting.<\/li>\n<li>Locate *.exe,*.com,*.bat entry, press Enter to edit.<\/li>\n<li>Add *.ps1 to the list, select Ok to save.<\/li>\n<\/ol>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"38\" data-permalink=\"https:\/\/chuchuva.com\/pavel\/2009\/08\/how-to-run-powershell-scripts-from-far-manager\/powershell-far\/\" data-orig-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/C%3A%5CHostingSpaces%5CPavel%5Cchuchuva.com%5Cwwwroot%5Cpavel\/images\/2009\/08\/powershell-far.png?fit=403%2C181&amp;ssl=1\" data-orig-size=\"403,181\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"powershell-far\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/C%3A%5CHostingSpaces%5CPavel%5Cchuchuva.com%5Cwwwroot%5Cpavel\/images\/2009\/08\/powershell-far.png?fit=403%2C181&amp;ssl=1\" class=\"alignnone size-full wp-image-38\" src=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/wp-content\/uploads\/2009\/08\/powershell-far.png?resize=403%2C181\" alt=\"\" width=\"403\" height=\"181\" \/><\/p>\n<p>See also: <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/topics\/winpsh\/manual\/run.mspx\">Running Windows PowerShell Scripts<\/a><\/p>\n<p><strong>Update<\/strong>: there is an <a href=\"http:\/\/chuchuva.com\/pavel\/2010\/03\/enhancement-to-launching-powershell-scripts-from-far-manager\/\">enhancement<\/a> that allows passing arguments to the script and launch script in a separate window.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s say you use Far Manager and want to launch PowerShell script. With default installation pressing Enter on PowerShell script in Far Manager will open the script in Notepad. Not very helpful. Here&#8217;s how to configure Far Manager to launch PowerShell script by pressing Enter key: Open Commands menu, select File associations. Press Ins key &hellip; <a href=\"https:\/\/chuchuva.com\/pavel\/2009\/08\/how-to-run-powershell-scripts-from-far-manager\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to run PowerShell scripts from Far Manager<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","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-34","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\/34","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=34"}],"version-history":[{"count":0,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}