Published Author | PowerShell Advanced Cookbook

Platform Engineer Technical Author

I am Morten Elmstrøm Hansen, a platform engineer in Denmark who builds Kubernetes platforms, automation and AI tooling, and the author of PowerShell Advanced Cookbook.

I work full time at Mind Energy, and in my own time I build tools and write about what I learn. I am always open to collaboration, to comparing notes on a technical problem, or to a conversation about the book.

14+
Years Building
1
Published Book
70+
Projects Since 2012
PowerShell Advanced Cookbook by Morten Elmstrøm Hansen

90+ recipes for advanced PowerShell scripting and automation

Available on Amazon

What I Work On

Three areas that run through my work, at Mind Energy and in my own projects: automation, the platforms it runs on, and explaining both clearly enough for others to use.

PowerShell and Automation

I turn manual, repeated work into scripts and pipelines that run the same way every time, in PowerShell and Python, from small administration tasks to scheduled jobs across many servers.

Platforms and Infrastructure

I build and run Kubernetes platforms with GitOps, infrastructure as code and CI/CD pipelines, on Azure at work and on a highly available K3s cluster at home.

Technical Writing

I wrote PowerShell Advanced Cookbook, and I document what I build in the same way: what it is, why it exists and how it works, so that someone else can use it and build on it.

Featured Projects

Three projects that show the range of my work: a business platform running in production, a knowledge system that gives AI assistants a long-term memory, and the Kubernetes cluster that runs most of what I build.

View All Projects

MopPilot

MopPilot is a multi-tenant software-as-a-service (SaaS) platform for cleaning businesses in Scandinavia, developed alongside the daily operations of Bio Rent and now running in production as a private beta. A cleaning business has to coordinate recurring service agreements, staff schedules, time registration, client records and invoicing, and when that work is spread across spreadsheets and calendars it costs hours every week and invites mistakes in billing. MopPilot brings those tasks into one application in which each organisation's data is kept separate from every other organisation's, field staff check in from a mobile-first screen that queues the check-in on the device when the connection drops, and invoices are sent to the e-conomic accounting system only as drafts, so nothing reaches the accounts until a person has approved it.

Python Flask PostgreSQL Celery Redis Kubernetes HTMX

Cortex

Cortex is a self-hosted retrieval-augmented generation (RAG) system that serves as a long-term memory for AI assistants. The knowledge that matters in daily work is spread across code repositories, email, notes and documents, and an assistant can only use what it is given in the conversation, so it repeatedly lacks context that already exists somewhere. Cortex collects content from those sources on a schedule, tags each piece with 46 deterministic rules and a language model, stores it as a vector embedding in PostgreSQL with pgvector, and answers questions with a hybrid search that combines semantic similarity with exact keyword matching. Claude Code queries it through the Model Context Protocol (MCP), other assistants through a REST API, and a person through its web interface.

Python FastAPI FastMCP pgvector Ollama PostgreSQL Kubernetes

Home Lab Infrastructure

Home Lab Infrastructure is a highly available Kubernetes cluster built on three K3s server nodes, which runs most of the projects on this page together with the platform services a production cluster needs. It exists so that the practices of production platform work, such as declared configuration, automatic certificates, replicated storage, monitoring, single sign-on and tested backups, are exercised every day on services in daily use. Every component is declared in Git and applied by Argo CD through an app-of-apps structure, in which 17 platform applications provide load balancing, ingress, certificates, storage, monitoring and secrets management, and 19 workload applications run on top.

Kubernetes K3s ArgoCD Helm MetalLB Longhorn Prometheus

Where It Started

Before any of this, I taught myself Python through 55+ projects, among them a voice-controlled assistant, a complete game, encryption tools and a Raspberry Pi controller.

PowerShell Advanced Cookbook by Morten Elmstrøm Hansen
Published Author

PowerShell Advanced Cookbook

My book is a practical guide to advanced PowerShell for IT professionals who already script and want to build reliable, reusable automation, with 90+ recipes across 684 pages, published by BPB Publications in 2024.

  • Advanced functions, flow control and error handling
  • Remote management, Active Directory and Microsoft 365
  • Managing Azure and AWS with PowerShell
  • Testing with Pester and Desired State Configuration

Get in Touch

If you are working on something similar, would like to compare notes on a Kubernetes or automation setup, or have a question about the book, I would like to hear from you.