PowerShell with Rust command-line tools
The following blog post is likely of interest to a small minority of Windows users. These data analysts in corporations, financial modelers and engineers with deadlines, SAP consultants... It's Windows-heavy, Microsoft-focused and emphasizes on ad-hoc batch processing of data. To get the job done.
When Microsoft released PowerShell in 2006, many Windows admins and “power users” had high hopes that the Subsystem for Unix-based Applications (SUA, which is also often referred to as Interix) would become a common standard in the Windows world. After all, Microsoft did develop a certified version of Unix named Xenix during the 1970s, showcasing their historical interest and capability in integrating Unix-like features into their systems. :) — As we all know, things turned out to be rather disappointing.
Many web sources claim that “Powershell” became an “integral tool”. That may very well be the case, but it’s not a productive tool. It’s not responsive enough, uses XML for remoting and serialization (of PSobjects) and to make things worse, Microsoft didn’t even release a proper terminal emulator until 2020. They injected their PowerShell development into cmd.exe. Making it look like a prototype software for over a decade.
The cmd.exe with the “Batch” language remained the default Windows command-line for decades
The cmd.exe era: 1993-2009
cmd.exe, which originates from the older COMMAND.COM, never really gained the same traction or widespread popularity as Bash (1989) or ZSH (also ‘89) with GNU core-utils (early 90ies), which bot today are widely adopted in various Unix-like systems.
Nowadays, the majority of Windows users have transitioned to utilizing WSL(2) (Windows Subsystem for Linux) for a streamlined command-line experience. WSL2 functions as a virtual machine manager, meaning that it effectively starts (in a headless configuration) various Linux distributions as a guest operating system, allowing users to seamlessly run Linux commands and applications within their Windows environment. But using an entire virtual machine guest for small ad-hoc tasks isn’t a versatile solution.
In 2024 / 25, comfortable new alternatives to GNU core-utils start appearing, mainly built with Rust or Go. GNU core-utils are usually written in C, and optimized for Unix or Linux operating systems. Rust or Go projects can often run on different Unix types, Linux versions, or on Windows. We can use these new modern “core” utils instead of the sluggish PowerShell equivalents or instead of the atavistic core-utils. Or with each other. This way we get into the right kind of vibe for the next decade: Neo-Unix graybeards. With rainbows and…
Git Bash, Cygwin, MSys
Due to the dissatisfaction with cmd.exe (and its overly simplistic terminal emulator) Git Bash, Cygwin or MSys never gained real traction.
Developers don’t use these environments because the ported core-utils are rather unreliable or slow.
For a long time, CLI libraries like Ncurses were incompatible with the 1990ies terminal emulator. That meant that editors like Vi(m) needed many workarounds to be compatible. A pain.
Configuring the Batch prompt to add Git branch information was impossible (or very hacky) for a long time.
Developers on macOS or Linux were just more productive. Which is the reason why today MacBooks dominate within the power-user and developer community. Microsoft lost its edge with the power users, professionals, and it’s losing with the sys admins as well.
When the DevOps trend emerged further, it became clear that terminal emulators serve an important purpose to interact with headless servers, container deployments, infrastructure as code and so on. For the next decades, that is.
Microsoft finished porting the OpenSSH client and server to Windows in 2019. Windows Server Core nowadays has got an OpenSSH server, which you can use. It can be practical to heedlessly log onto busy systems via SSH, or to automate software provisioning this way (via Ansible or other means). PowerShell Remoteing and other Microsoft-specific ideas remained, but OpenSSH is the dominating industry standard. Microsoft does not have the power to establish their own, given that Windows Server only covers a fraction of the server operating system market. An important fraction, however.
Cross-platform neo-Unix style
The following paragraphs collect ideas on how to get a
highly responsive
core-utils like
and spiffed up
terminal environment which can host robust (data) processing workflows with native speeds. Without virtualization or extra fluff, that’s going to break once you load up some large datasets.
Package Managers for command-based software installs
In the BSD / Linux / Unix world, package managers are the standard. Apt, RPM or pkg. For Windows, the currently en vogue package manager is scoop. Chocolatey ran out of favors because of some licensing problems. Winget is fine, but for the most part, it’s scoop. It has more packages. If you need multiple development environments, it’s sdk-man.
Enhance the prompt with oh-my-posh
oh-my-posh adds status information regarding the hostname, time, Git etc.. Similar to ZSH or Bash.
This is Windows Terminal using oh-my-posh, with added Git status infos. Inline syntax-highlighting and more.
Terminal multiplexing with Vim (hacky)
The projects screen, tmux or even zellij are incompatible to Windows. But vimux is. Granted, this is extremely basic. And I don’t use this, but it’s at least something.
vimux just uses vim (WIdows buid). It adds the status line at the top. But it cannot use fancy prompts.
Fuzzy Powershell history and advanced tab completion
Powershell has a module to add Readline compatibility. If you use it, you can use fuzzy tab-completion, history search and auto-complete prediction.
for the search and advanced tab completion, bind PSfzf to CRTL + R as well as to Tab.
bind Arrow Up to the PSReadLineKeyHandler
Use the PowerShell history as well as the PSReadLine plugin as the basis for the auto-completion (confirm with Right Arrow)
Optional: add intelli-sense to PowerShell (I don’t use this much, but it’s probably good)
CRTL + R triggered PSfzf in Windows Terminal (PSReadLine imported)
scoop install eza - the LS pendant
eza is compatible with Windows and it can replace PowerShell’s ls. The key difference for PowerShell usage is, that the Rust-based tool much faster. And more Unix like. If you like sorting files on the command-line, this setup, in combination with the tab and history completion, will save you a lot of time.
eza is a modern, maintained replacement for the venerable file-listing command-line program
ls
that ships with Unix and Linux operating systems, giving it more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary.By deliberately making some decisions differently, eza attempts to be a more featureful, more user-friendly version of
ls
.
ps aux - with procs
For a long time, there was no ps aux equivalent on Windows. Yes, tasklist, but that never really delivered the same usability. procs adds this to Windows.
Listing processes, sorted in descending order based on CPU %
scoop install zoxide - CD pendant
I also don’t like PowerShell’s sluggish cd tool. Zoxide builds a reference list of frequently accessed directories, and enhances the tab completion this way. You can configure a list of shortcuts like ~/.config (yes on Windows, for NeoVim etc.), AppData/Local etc. etc..
Further tools
Summary
Command-line matters. For sorting files, starting batch jobs, compiling code etc.. It also matters for AI. Just pipe logs and data to Shell GPT. Or use pre-defined prompts and AI-workflows with fabric. Endless possibilities. Powershell itself is also great at handling CSVs. Or for Excel automation with COM objects. If you dislike Windows Terminal, you can check out very fancy alternatives like WezTerm or Wave. The reason why there is so much development in this era is because it’s needed. Even in the corporate world.