PowerShell Toolkit · part of ReliabilityOps

The read-only one-liner
you almost remembered.

Pull the status of a service, a session, a disk, an availability group, an event log, without memorizing the incantation. Every command here only reads. Copy it, paste it into your own console, stay in control of what runs on the box.

✓ Read-only commands only ✓ Nothing changes state ✓ Nothing installs ✓ Stays in your browser

What do you need to check?

Filter by area or search. Read-only Windows and SQL diagnostics. Copy and run in your own session.

Read-only by design: nothing here starts, stops, kills, or changes anything. Where a real fix needs a state change (restart a service, kill a session), the note tells you the command but does not run it. You decide what executes on the server, which is what a change-controlled or audited shop expects.

SQL Server, from PowerShell

Health checks and Always On visibility using Invoke-Sqlcmd and dbatools. All SELECT / read-only.

Trouble signatures

The Windows and SQL failures that page you, what they look like, and the read-only confirm.

Quick reference

Read-only habits

  • Get-* cmdlets read. Set/Stop/Start/Restart/Remove change. Stay on Get during triage.
  • Add | Format-Table -Auto or | Out-GridView to read wide output.
  • -WhatIf shows what a changing command WOULD do without doing it.

Run against a remote box

  • Invoke-Command -ComputerName SRV -ScriptBlock { Get-Service }
  • Needs WinRM. Read-only remoting is fine for triage.
  • Enter-PSSession SRV for an interactive read-only look.

Service states

  • Running, Stopped, StartPending, StopPending.
  • StartPending that never clears usually means a dependency or a hung start.
  • Check the dependency chain: Get-Service X -RequiredServices.

Event log levels

  • Level 1 Critical, 2 Error, 3 Warning, 4 Information.
  • System log for service/driver/boot, Application for app + SQL.
  • Filter fast with -FilterHashtable @{LogName='System';Level=1,2}.

dbatools, quickly

  • Install once: Install-Module dbatools -Scope CurrentUser.
  • Read-heavy verbs: Get-Dba*, Test-Dba*.
  • Get-DbaLastBackup, Get-DbaAgHealth, Test-DbaLastBackup.

Where SQL logs live

  • ERRORLOG: Get-DbaErrorLog or the LOG folder in the instance dir.
  • AG health: sys.dm_hadr_availability_replica_states.
  • Windows Application log carries MSSQLSERVER events too.