@Vinkyu567: https://x.com/Vinkyu567/status/2079475456290816050
Summary
This article guides Windows users to upgrade their default terminal from Windows PowerShell 5.1 to PowerShell 7, improving compatibility with AI agents and reducing coding and command execution errors.
View Cached Full Text
Cached at: 07/21/26, 06:48 PM
Upgrade Your Windows, Become a First‑Class AI Citizen
If you’ve used both Windows and macOS, you know the experience of using AI agents on these two operating systems is worlds apart.
The biggest root cause is that Windows’ command‑line tool, PowerShell, is not friendly to AI. Most of the command‑line operations in AI model training data follow the Linux/macOS style.
This often leads to errors when we use agents on Windows, wasting tokens for no reason.
This article will teach you how to upgrade your Windows so that we Windows users can also enjoy the smooth agent experience on a Mac.
First, get to know three names:
| Name | What It Is | Launch Command | How to Use |
|---|---|---|---|
| Windows PowerShell 5.1 | Built‑in old Shell | powershell or powershell.exe | For old modules and system compatibility |
| PowerShell 7 | New version built on modern .NET | pwsh or pwsh.exe | Preferred for daily AI, development, and automation |
| Windows Terminal | Terminal window that hosts different shells | wt | Set PowerShell 7 as the default profile |
For most of us, the computer comes with Windows PowerShell 5.1 – a command environment released in 2016 and built on the old .NET Framework.
Windows PowerShell 5.1 is a system component that handles legacy module compatibility. But when you run today’s AI CLIs, npm scripts, and new tutorials with it, you’ll notice significantly more environment friction. Many commands in Windows PowerShell 5.1 use different legacy default encodings. When files, pipes, logs, and external programs mix together, Chinese characters can become garbled, and JSON or config files may be written in encodings that downstream tools don’t accept.
PowerShell 7 unifies more default scenarios to UTF‑8 without BOM. It doesn’t eliminate all encoding issues, but it reduces a number of common conflicts.
Therefore, we need to upgrade our daily terminal to PowerShell 7.
First, let’s check which version of PowerShell is on your computer. Press Win + R to open the Run dialog, type powershell, and open the corresponding window.
In the PowerShell window, type:
$PSVersionTable.PSVersion
You can clearly see that we are still on PowerShell 5.1.
Now Let’s Install PowerShell 7
1️⃣ Check WinGet
Open Windows Terminal, Command Prompt, or an existing PowerShell, and run:
winget --version
If a version number is returned, you can proceed.
If the system says winget is not found, first update or install Microsoft’s “App Installer” from the Microsoft Store.
2️⃣ Install PowerShell 7
First, confirm that WinGet finds the official Microsoft package:
winget search --id Microsoft.PowerShell --exact
Then install:
winget install --id Microsoft.PowerShell --source winget
A User Account Control window may pop up during installation. Verify the publisher and package ID before continuing.
If you already have PowerShell 7 installed, you can check and upgrade with these commands:
winget list --id Microsoft.PowerShell --upgrade-available
winget upgrade --id Microsoft.PowerShell
3️⃣ Start the New Version with pwsh
After installation, close the current terminal window, open a new one, and type:
pwsh
Then check again:
$PSVersionTable.PSVersion
$PSVersionTable.PSEdition
$PSHOME
Look for three signals:
- The major version shows 7.
PSEditionshowsCore.$PSHOMEpoints to PowerShell 7’s installation directory – for example,Program Files\PowerShell\7or a PowerShell package folder underWindowsApps.
If pwsh says command not found, restart Windows Terminal, VS Code, Cursor, or whatever AI client you’re using. The installer updated PATH, but old processes usually don’t see the new environment variables.
If it still can’t be found, run:
where.exe pwsh
Get-Command pwsh -All
At this point, the installation of PowerShell 7 is complete.
4️⃣ Set PowerShell 7 as the Default Terminal
Here we take Codex as an example. Simply tell Codex to check:
Please run the following commands and tell me the current PowerShell version and executable path:
$PSVersionTable.PSVersion (Get-Process -Id $PID).Path
If Codex still shows PowerShell 5.1, add the following to your global AGENTS.md:
## Windows Shell Rules
- The current system has PowerShell 7 installed.
- All PowerShell commands must be executed using `pwsh.exe`.
- Do not use the old `powershell.exe`.
- When executing PowerShell commands, use the following form:
`pwsh.exe -NoLogo -NoProfile -Command "<command>"`
- Before executing any commands for the first time, run:
`pwsh.exe -NoLogo -NoProfile -Command "$PSVersionTable.PSVersion"`
- If PowerShell 7 is not available, stop and inform the user; do not fall back to Windows PowerShell 5.1.
Similar Articles
@ChrisWangwy: https://x.com/ChrisWangwy/status/2064589910485684254
Microsoft has released Coreutils for Windows, bringing 78 Unix-like commands to the native Windows terminal, enabling AI agents (such as Hermes, Claude Code) to use commands like grep and ls directly on Windows, reducing translation overhead. The article details installation steps, alias conflicts, and acceptance methods.
@SaitoWu: https://x.com/SaitoWu/status/2069076084495438186
This article describes using the Codex AI agent to automatically migrate terminal shell configuration from Oh My Zsh to Zinit + Starship + Rust toolchain, demonstrating the AI's ability to perform engineering steps such as backup, key isolation, and performance analysis, ultimately achieving an order-of-magnitude improvement in startup speed.
@Smartpigai: https://x.com/Smartpigai/status/2091446028537061629
This article analyzes the trend of AI Agents shifting from MCP to CLI, discusses the advantages of CLI in local execution, context saving, and debugging, and points out the potential future division of labor between MCP and CLI.
@GitHub_Daily: Microsoft recently open-sourced an AI terminal: Intelligent Terminal, based on Windows Terminal, with an AI assistant built into the terminal. It can automatically detect command-line output, and when errors occur, send the context to AI for analysis with one click, without manual copy-paste, and can even directly help execute...
Microsoft open-sourced Intelligent Terminal, an AI-powered terminal based on Windows Terminal that integrates AI assistants to help with command-line errors and tasks.
@Chenzeze777: Microsoft should be worried. Someone wrote an open-source PowerShell script (51K+ stars) that wipes out all the junk pre-installed in Windows—pre-installed apps, ad tracking, Copilot, Recall, Bing search—with a single command. Microsoft shoves C…
Win11Debloat is an open-source PowerShell script that can remove pre-installed apps, ad tracking, Copilot, Recall, etc. from Windows 11 with a single click, restoring the system's cleanliness.