{"id":68057,"date":"2022-10-22T09:00:55","date_gmt":"2022-10-22T09:00:55","guid":{"rendered":"https:\/\/www.cryptocabaret.com\/?p=68057"},"modified":"2022-10-22T09:00:55","modified_gmt":"2022-10-22T09:00:55","slug":"use-open-source-commands-in-powershell","status":"publish","type":"post","link":"https:\/\/www.cryptocabaret.com\/?p=68057","title":{"rendered":"Use open source commands in Powershell"},"content":{"rendered":"<p><span class=\"field field--name-title field--type-string field--label-hidden\">Use open source commands in Powershell<\/span><br \/>\n<span class=\"field field--name-uid field--type-entity-reference field--label-hidden\"><a title=\"View user profile.\" href=\"https:\/\/opensource.com\/users\/alansmithee\" class=\"username\">Alan Smithee<\/a><\/span><br \/>\n<span class=\"field field--name-created field--type-created field--label-hidden\">Sat, 10\/22\/2022 &#8211; 03:00<\/span><\/p>\n<div class=\"clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item\">\n<p>When you launch an application on an operating system, there are certain code libraries and utility applications that your OS needs to use for that app to run. Your OS knows how to find these libraries and utilities because it has a <em>system path,<\/em> a map to common shared data that lots of apps need. Every OS has this, but users aren\u2019t usually aware of it because they don\u2019t usually need to care about it. However, when you start coding or using special network utilities or commands, you might care about your own PATH variable.<\/p>\n<\/p>\n<div class=\"embedded-resource-list callout-float-right\">\n<div class=\"field field--name-title field--type-string field--label-hidden field__item\">More great content<\/div>\n<div class=\"field field--name-links field--type-link field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/www.redhat.com\/en\/services\/training\/rh024-red-hat-linux-technical-overview?intcmp=7016000000127cYAAQ\">Free online course: RHEL technical overview<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/developers.redhat.com\/cheat-sheets\/advanced-linux-commands\/?intcmp=7016000000127cYAAQ\">Learn advanced Linux commands<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/cheat-sheets?intcmp=7016000000127cYAAQ\">Download cheat sheets<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/linux?intcmp=7016000000127cYAAQ\">Find an open source alternative<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/resources?intcmp=7016000000127cYAAQ\">Explore open source resources<\/a><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<p>The PATH variable makes it so that you can save commands to a consistent location, and use them from anywhere on your system using the command prompt or the more powerful (and open source) <a href=\"https:\/\/opensource.com\/article\/18\/2\/powershell-people\">Powershell<\/a>.<\/p>\n<p>For instance, say you want to install the open source application <code>pscp.exe<\/code>, a command-line interface to the famous PuTTY OpenSSH client on Windows. You can download it to your hard drive, but how does your command-line know that it exists? Well at first, it doesn\u2019t:<br \/>\n\u00a0<\/p>\n<pre>\n<div class=\"geshifilter\"><div class=\"bash geshifilter-bash\">PS<span class=\"sy0\">&gt;<\/span> pscp<br>\npscp: The term <span class=\"st_h\">'pscp'<\/span> is not recognized <span class=\"kw2\">as<\/span> the name of a cmdlet, script <span class=\"kw2\">file<\/span>, or operable program. <br>\nCheck the spelling of the name, or <span class=\"kw1\">if<\/span> a path was included, verify that the path is correct and try again.<\/div><\/div><\/pre>\n<p>If you\u2019re using an open source command line, such as Powershell or <a href=\"http:\/\/cmder.app\/\">Cmder<\/a>, you get a useful error hinting that this might be a problem with your path (or the lack thereof). Here\u2019s how to solve that problem.<\/p>\n<h2>Setting a PATH<\/h2>\n<ol>\n<li>\n<p>First, create a folder called <code>App<\/code> on your Desktop.<\/p>\n<\/li>\n<li>\n<p>Next, right-click on the Windows menu in the bottom left corner of your screen, and select <strong>System<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/windows-menu-system.png\" width=\"822\" height=\"517\" alt=\"Image of the Windows menu system.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Alan Smithee, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<ol start=\"3\">\n<li>\n<p>In the <strong>System<\/strong> window that appears, click the link to <strong>Advanced system settings<\/strong> on the left of the window.<\/p>\n<\/li>\n<li>\n<p>In the <strong>System properties<\/strong> window that appears, click the <strong>Environment variables<\/strong> button at the bottom of the window.<\/p>\n<\/li>\n<\/ol>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/windows-system-environment-variables.png\" width=\"408\" height=\"467\" alt=\"Image Windows system enviroment variables.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Alan Smithee, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<ol start=\"5\">\n<li>In the <strong>Environment variables<\/strong> window, click the <strong>New<\/strong> button under the <strong>User variables<\/strong> panel.<\/li>\n<\/ol>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/windows-environment-variables-new.png\" width=\"595\" height=\"393\" alt=\"Image of new Windows enviroment variables.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Alan Smithee, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<ol start=\"6\">\n<li>In the dialog box that appears, enter <code>PATH<\/code> for the <strong>Variable name<\/strong> field, and <code>%USERPROFILEDesktopApp<\/code> for the <strong>Variable value<\/strong> field. Click the <strong>OK<\/strong> button to save your changes.<\/li>\n<\/ol>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/windows-path-set.png\" width=\"652\" height=\"164\" alt=\"Image of Windows path set.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Alan Smithee, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<p>Place commands and applications you want to have access to from a command prompt in <code>DesktopApps<\/code> and Powershell, Cmder, and even Cmd will find them:<br \/>\n\u00a0<\/p>\n<pre>\n<div class=\"geshifilter\"><div class=\"bash geshifilter-bash\">PS<span class=\"sy0\">&gt;<\/span> pscp \u2013version<br>\npscp: Release <span class=\"nu0\">0<\/span>.XY<br>\nBuild platform: <span class=\"nu0\">64<\/span>-bit x86 Windows<br>\nPS<span class=\"sy0\">&gt;<\/span> <\/div><\/div><\/pre>\n<h2>Automatic PATH settings<\/h2>\n<p>Many applications get automatically added to the system path during installation. However, not all of them do, either because you missed a check box during the install process, or because the application developer expects you to add it yourself. When automatic paths fail, you now know how to forge your own path.<\/p>\n<\/div>\n<div class=\"clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item\">\n<p>Set your path on Windows so you can use open source commands.<\/p>\n<\/div>\n<div class=\"field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item\">\n<article class=\"media media--type-image media--view-mode-caption\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/bash_command_line.png\" width=\"520\" height=\"293\" alt=\"bash logo on green background\" title=\"bash logo on green background\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>Opensource.com<\/p>\n<\/div>\n<\/article>\n<\/div>\n<div class=\"field field--name-field-tags field--type-entity-reference field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/command-line\" hreflang=\"en\">Command line<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/windows\" hreflang=\"en\">Windows<\/a><\/div>\n<\/p><\/div>\n<div class=\"hidden field field--name-field-listicle-title field--type-string field--label-hidden field__item\">What to read next<\/div>\n<div class=\"field field--name-field-default-license field--type-list-string field--label-hidden field__item\"><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><br \/>\n        <img decoding=\"async\" alt=\"Creative Commons License\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/cc-by-sa--23.png\" title=\"This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.\"><\/a>This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.<\/div>\n<section class=\"field field--name-field-comments field--type-comment field--label-hidden comment-wrapper\">\n<div class=\"comments__count\">\n<div class=\"login\"><a href=\"https:\/\/opensource.com\/user\/register?absolute=1\">Register<\/a> or <a href=\"https:\/\/opensource.com\/user\/login?current=\/rss.xml&amp;absolute=1\">Login<\/a> to post a comment.<\/div>\n<\/p><\/div>\n<\/section>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\" rel=\"noopener\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use open source commands in Powershell Alan Smithee Sat, 10\/22\/2022 &#8211; 03:00 When you launch an application on an operating system, there are certain code libraries and utility applications that your OS needs to use for that app to run. Your OS knows how to find these libraries and utilities because it has a system [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":68058,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[307],"tags":[],"class_list":["post-68057","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source"],"_links":{"self":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/68057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=68057"}],"version-history":[{"count":0,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/68057\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/media\/68058"}],"wp:attachment":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}