Skip to main content
PowerShell is the command shell and scripting language built into Windows Server. Open it as administrator, then use Get-Command to find commands, Get-Help <command> -Examples to see how they work, and verb-noun cmdlets such as Get-Service, Restart-Service, Get-ChildItem and Test-NetConnection for daily tasks. Windows Server 2019, 2022 and 2025 include Windows PowerShell 5.1, and scripts run by default under the RemoteSigned execution policy.

Before you start

  • Sign in with Remote Desktop or the VNC console.
  • Most admin tasks need an elevated window (run as administrator). Commands that change the system fail with an access-denied error in a normal window.

How to open PowerShell as administrator

Select Start, type PowerShell, right-click Windows PowerShell and choose Run as administrator. The title bar starts with Administrator:.

How PowerShell commands are named

Cmdlets (PowerShell commands) use a Verb-Noun pattern: Get-Service reads services, Stop-Service stops one, Set-TimeZone changes a setting. Parameters start with a hyphen: Get-Service -Name W3SVC. Press Tab to complete command and parameter names.

How to find commands and get help

The modules that come with Windows don’t include full help files, so Get-Help shows only basic information until you download them. Do that once, in an admin window:
Get-Help <command> -Online opens the Microsoft Learn page for that command in your browser.

Commands you will use every day

System information

Get-Volume shows each drive with its free and total space.

Services

Use the service’s Name (not its display name) from Get-Service. Here W3SVC stands for the IIS web service and sshd for OpenSSH Server.

Processes

The first line lists the ten processes that have used the most CPU time.

Files and folders

-Tail 50 shows the last 50 lines. Adding -Wait keeps the file open and prints new lines as they are written, like tail -f on Linux; press Ctrl+C to stop.

Download and unzip

In Windows PowerShell 5.1, -UseBasicParsing avoids a security prompt and stops the downloaded page from running script (Invoke-WebRequest on Microsoft Learn).

Network

Test-NetConnection shows TcpTestSucceeded : True when the port answers. Get-NetTCPConnection -State Listen lists every port the server is listening on.

Restart and shut down

Stop-Computer powers the server off. On a VPS you then need to boot it from the VPS Panel. Use Restart-Computer unless you really want it off.

How the pipeline works

The | (pipe) passes objects from one command to the next. PowerShell passes whole objects with properties, not just text, so you can filter and sort on any property:
This lists services that should start automatically but aren’t running, a quick health check after a restart.

How to run a PowerShell script

Save commands in a file ending in .ps1, for example C:\Scripts\cleanup.ps1, and run it:
Check the execution policy:
On Windows Server the default is RemoteSigned: scripts you write on the server run, but scripts downloaded from the internet must be signed or unblocked first (about_Execution_Policies). If you trust a downloaded script, unblock it:
Don’t set the execution policy to Unrestricted or Bypass for the whole machine to get one script working. Unblock or sign that script instead.

Windows PowerShell 5.1 or PowerShell 7?

PowerShell 7 installs side by side with 5.1. Microsoft recommends the MSI package for Windows Server; on Windows Server 2025 with Desktop Experience you can also use winget install --id Microsoft.PowerShell --source winget (Microsoft Learn). For server administration, 5.1 is enough to start.

Frequently asked questions

What is the difference between PowerShell and Command Prompt?

Command Prompt (cmd.exe) runs older commands and batch files. PowerShell runs those same tools plus cmdlets that return objects, which makes filtering, scripting and remote management much easier. Most Microsoft documentation for Windows Server now uses PowerShell.

Is PowerShell case-sensitive?

No. get-service and Get-Service do the same thing. Some values you pass, such as winget package Ids with -e, can be case-sensitive.

How do I see my command history?

Run Get-History, or press the Up arrow to step through earlier commands.

Can I use Linux commands like ls and cat?

Yes, as aliases: ls and dir run Get-ChildItem, and cat runs Get-Content. Their options are PowerShell’s, not Linux’s.

VPS and dedicated server guides

Every guide in this section.

Install software with winget

Package manager on Windows Server 2025.

Install roles and features

Install-WindowsFeature explained.

Enable OpenSSH Server

Run PowerShell over SSH.

Use Event Viewer to find errors

Read Windows logs.

Checked against Microsoft Learn: PowerShell 5.1 cmdlet reference, about_Execution_Policies, SConfig and Install PowerShell on Windows on 4 November 2026. Not tested on a live Windows server for this page.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026