diff --git a/src/.obsidian/workspace.json b/src/.obsidian/workspace.json index 0404e54e..5e595bbb 100644 --- a/src/.obsidian/workspace.json +++ b/src/.obsidian/workspace.json @@ -102,9 +102,21 @@ "source": false } } + }, + { + "id": "c6e726f8aada69c0", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "How-to/Run a tool globally on Windows.md", + "mode": "source", + "source": false + } + } } ], - "currentTab": 6 + "currentTab": 8 } ], "direction": "vertical" @@ -170,9 +182,9 @@ "state": { "type": "backlink", "state": { - "file": "Cloud/AWS/Cognito.md", - "collapseAll": true, - "extraContext": true, + "file": "How-to/Run a tool globally on Windows.md", + "collapseAll": false, + "extraContext": false, "sortOrder": "alphabetical", "showSearch": false, "searchQuery": "", @@ -187,7 +199,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "Cloud/AWS/Cognito.md", + "file": "How-to/Run a tool globally on Windows.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -210,7 +222,7 @@ "state": { "type": "outline", "state": { - "file": "Cloud/AWS/Cognito.md" + "file": "How-to/Run a tool globally on Windows.md" } } }, @@ -226,7 +238,7 @@ } ], "direction": "horizontal", - "width": 580.5 + "width": 271.5 }, "left-ribbon": { "hiddenItems": { @@ -239,8 +251,10 @@ "webpage-html-export:Export Vault to HTML": false } }, - "active": "418ab84c808d127b", + "active": "c6e726f8aada69c0", "lastOpenFiles": [ + "Management/Psychological Safety.md", + "How-to/Run a tool globally on Windows.md", "Cloud/AWS/Moto.md", "Cloud/AWS/Cognito.md", "Cloud/AWS/Index.md", @@ -269,8 +283,6 @@ "Management/Health Monitor.md", "Management/High Performing Teams.md", "Management/Hiring.md", - "Management/Leadership.md", - "Management/Management.md", "Frontend", "How-to/Git", "How-to/Powershell", diff --git a/src/How-to/Run a tool globally on Windows.md b/src/How-to/Run a tool globally on Windows.md new file mode 100644 index 00000000..ee979de8 --- /dev/null +++ b/src/How-to/Run a tool globally on Windows.md @@ -0,0 +1,23 @@ +To add a folder to the `PATH` environment variable: + +1. In Windows File Explorer, navigate to the folder containing the EXE. +2. Copy the full path to the folder from the address bar. +3. Open the Start menu, search for "Environment Variables", and select "Edit the system environment variables". +4. Click the "Environment Variables" button. +5. Under "System Variables", scroll down and select "Path", then click "Edit". +6. Click "New", paste the path to the folder containing the EXE, and click "OK" on all open windows. +7. Open a command prompt window and type the name of the EXE. It should run from any folder because the folder is included in the `PATH` environment variable. + + +The folder must be under `C:\Program Files\local-dev-cli`, then you can run `localdev` (`localdev.exe`) from anywhere + +```csharp +//Make the tool accesible globally +string folderPathToAdd = @"C:\Program Files\local-dev-cli"; +string pathVariable = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine) ?? ""; +if (!pathVariable.Contains(folderPathToAdd)) +{ + pathVariable = $@"{folderPathToAdd};{pathVariable}"; + Environment.SetEnvironmentVariable("Path", pathVariable, EnvironmentVariableTarget.Machine); +} +``` \ No newline at end of file