---
type: note
tags: [share, cli, terminal, windows, powershell, path, user, environment, variable, note]
created: 2025-11-09T17:38:41.653+00:00
updated: 2026-01-02T01:39:32.364Z
---# add path to environment variable via powershell

$path = [Environment]::GetEnvironmentVariable("PATH", "User")\n$appPath = "C:\Program Files\MyApp"\nif ($path -notlike "*$appPath*") {\n    [Environment]::SetEnvironmentVariable("PATH", "$path;$appPath", "User")\n}


## Media

![add path to environment variable via powershell](./attachments/og-f5913feb-668a-46e4-8e4c-2628384058c8.png)

## Links

- [share link to this card](https://fastdesk2.lovable.app/share/5fdf0711-e4b1-48d2-9d2d-46773b2343a8)


---
**Keywords:** share, cli, terminal, windows, powershell, path, user, environment, variable, note
