Local AI use cases with PowerShell

PowerShell is Microsoft's cross-platform shell and scripting language. These use cases wire a local model into a PowerShell profile or script so day-to-day terminal work never leaves the machine.

2 real examples, each linked to its original source.

Getting OpenCode to work with a local Ollama model by fixing the 4,096-token context

OpenCode on a local Ollama model ignored files, invented tasks or looped, because each ~23k-token request was silently cut to fit Ollama's default 4,096-token context on a 16 GB GPU.

DEV Community (Davidrs) · 2026-11-27

A PowerShell 7 profile that talks to a local Ollama model, with a human gate on every command

Shahriar Haque Abir put ask, fix, brief, mem and news commands in his PowerShell 7 profile, calling a local Ollama model on loopback so system output never goes to a cloud chat.

Shahriar Haque Abir on DEV · 2026-11-19