CLI.NEWS / TUTORIAL

Using the CLI on Windows

From PowerShell to Windows Terminal to WSL — a systematic introduction to the modern command-line environment and development workflows on Windows.

Terminal options

Windows gives you several terminal entry points. The legacy Command Prompt still exists, but modern development is far better served by Windows Terminal as the unified host for PowerShell, CMD, WSL, and related environments.

  • Windows Terminal — Microsoft's modern terminal host with tabs, split panes, themes, and GPU rendering.
  • PowerShell — Microsoft's modern shell and scripting language, built around object pipelines.
  • CMD — The legacy command interpreter, still useful for old batch files but not ideal as a modern daily shell.

You can launch these through the Start menu, or open Windows Terminal directly in the current folder by typing wt in File Explorer's address bar.

PowerShell basics

The biggest difference between PowerShell and Bash is the data model. Bash primarily works with text streams, while PowerShell pipes full objects between commands. That changes how filtering, sorting, and inspection work.

# Check PowerShell version
PS> $PSVersionTable.PSVersion

# Get help for a command
PS> Get-Help Get-ChildItem -Detailed

# Find available commands
PS> Get-Command *service*

PowerShell command names usually follow a Verb-Noun pattern such as Get-Process or Set-Location, which makes them predictable. It also ships with Unix-style aliases like ls, cd, and pwd, which lowers the barrier for Bash users.

Package managers

Windows now has two common command-line package managers: Microsoft's winget and the community-maintained Chocolatey. Both help replace manual installer downloads with repeatable commands.

# winget
PS> winget install Git.Git
PS> winget install Microsoft.VisualStudioCode
PS> winget install OpenJS.NodeJS.LTS

# Chocolatey
PS> choco install git nodejs python vscode -y

# Search available packages
PS> winget search python

In most cases, winget is the best place to start because it fits naturally into the Windows ecosystem. Chocolatey is still useful as a supplement.

WSL: Linux on Windows

WSL (Windows Subsystem for Linux) lets you run a real Linux distribution directly on Windows without managing a full VM or dual-boot setup. For developers who need Bash, apt, Docker, or Linux-native tooling, it is often the smoothest option.

# Install WSL (Ubuntu by default)
PS> wsl --install

# List available distributions
PS> wsl --list --online

# Enter WSL
PS> wsl
$ sudo apt update && sudo apt upgrade

# Access Windows files from WSL
$ ls /mnt/c/Users/
  • Filesystem interop — WSL sees Windows files under /mnt/c/, while Windows can reach Linux files under \\wsl$.
  • VS Code integration — With the WSL extension installed, code . opens projects directly from the Linux side while keeping the editor on Windows.

Developer tool setup

Most Windows development tooling can now be installed directly from the command line. A practical setup path looks like this:

Recommended setup sequence:
  1. Make sure Windows Terminal is available.
  2. Upgrade to PowerShell 7.x.
  3. Install Git, Node.js, Python, and other core tools through winget.
  4. Configure Git and SSH keys.
  5. Add WSL if Linux tooling is part of your workflow.
# Install PowerShell 7
PS> winget install Microsoft.PowerShell

# Install core dev tools
PS> winget install Git.Git
PS> winget install OpenJS.NodeJS.LTS
PS> winget install Python.Python.3.12

# Configure Git
PS> git config --global user.name "Your Name"
PS> git config --global user.email "your@email.com"

Productivity tips

These habits can make Windows terminal work more efficient day to day:

  • Tab completion

    PowerShell supports completion for commands, parameters, paths, and many Git-related cases.

  • Command history

    Use the arrow keys for command history, Ctrl+R for reverse search, and Get-History for the full list.

  • Windows Terminal shortcuts

    Shortcuts like Ctrl+Shift+T for new tabs and Alt+Shift+D for split panes are worth learning early.

  • Object pipelines

    Because PowerShell pipelines objects instead of raw text, sorting and filtering workflows are often more structured and reliable.

  • Execution policy

    Script execution is restricted by default, so you often need to set a development-friendly execution policy.

Next steps

Once the basics are comfortable, good next directions include:

  1. Learn PowerShell scripting and automate workflows with .ps1 files.
  2. Go deeper with WSL for a fuller Linux development experience on Windows.
  3. Customize Windows Terminal themes and shortcuts.
  4. Get comfortable with SSH and key-based authentication.
  5. Try AI coding assistants such as Claude Code or Copilot CLI directly in the terminal.

References