Skip to the workspace
Pebellslearn by building
Operating System  ›  Capstone Project

Windows Server and PowerShell

Windows 12 minWindows Server runs Microsoft-stack workloads as services managed with PowerShell, whose Verb-Noun commands pass objects rather than text, and whose CRLF line endings differ from Linux.

devops / Windows Server and PowerShell

Explore each scene at your own pace.

01 · The rule

The rule

Windows Server and PowerShell

Not every workload is on Linux. A company's payroll app runs on Windows Server with IIS, and its users sign in through Active Directory. When it breaks at night, you need to be as comfortable there as on web1.

The rule

On Windows, think services, PowerShell objects and CRLF line endings.

Windows Server runs workloads that are built on Microsoft's stack: Active Directory for users and machines, IIS for web apps, SQL Server, and many .NET applications. Modern servers are often installed as Server Core, with no desktop at all, so you manage them from the command line or remotely.

Services. Long-running programs are Windows services, the equivalent of systemd units. You list and control them with PowerShell:

Get-Service -Name W3SVC            # IIS web service status
Restart-Service -Name W3SVC
Get-WinEvent -LogName System -MaxEvents 20   # recent system log entries

PowerShell passes objects, not text. On Linux, a pipe sends plain text and you cut columns out of it. In PowerShell each item is an object with named properties, so you sort and filter by name:

Get-Process | Sort-Object CPU -Descending | Select-Object -First 5 Name, CPU

PowerShell commands follow a Verb-Noun pattern: Get-, Set-, Start-, Stop-, Restart-, New-, Remove-. PowerShell also runs on Linux and macOS today.

Line endings. Windows text files end lines with carriage return plus line feed (CRLF); Linux uses only line feed (LF). A shell script saved with CRLF on Windows fails on Linux with a confusing bad interpreter error, because the invisible \r becomes part of the command.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.