Skip to content

PowerShell: reading and safely modifying an existing script

For service desk, MSP and endpoint technicians who inherit PowerShell scripts (cleanup jobs, account changes, RMM tasks) and need to understand them before changing anything. You should already be able to run cmdlets and use the pipeline (see PowerShell for desktop diagnostics). The course covers reading a script's help, parameters and flow; predicting what happens when a command fails; previewing changes with -WhatIf and -Confirm; what execution policy does and does not protect against; and making one small, tested, recorded change. Examples follow the PowerShell 7.6 documentation; most of it applies to Windows PowerShell 5.1 as well. Ends with a supervisor-graded script review and modification.

Level
Intermediate
Length
About 90 minutes
Contents
5 lessons · final exam
Status
Published · updated 10 Oct 2026

Skills you'll practise

  • Read an existing script's help, parameters and flow and identify every line that changes the system
  • Predict whether a failing command stops the script, is caught by try/catch, or is silently ignored
  • Add and use -WhatIf and -Confirm support to preview a script's changes before they happen
  • Choose a safe way to run a reviewed script without weakening execution policy
  • Make one small, tested and recorded change to a script using strict mode and a static checker

Course outline

  1. 1.Read an existing script before you change itLesson · 16 min
  2. 2.Predict what happens when a command failsLesson · 18 min
  3. 3.Preview changes with -WhatIf and -ConfirmLesson · 16 min
  4. 4.Run a reviewed script without weakening execution policyLesson · 14 min
  5. 5.Make one small, tested and recorded changeLesson · 10 min
  6. 6.PowerShell: reading and safely modifying an existing script: knowledge checkKnowledge check · 14 questions
  7. 7.PowerShell: reading and safely modifying an existing script: practical exerciseKnowledge check · 1 question
  8. 8.Final exam10 questions · passing it completes the course, so people who already know the material can test out

Sources it draws on

The lessons and questions are written from these references, so learners can go back to the original.

See it with your own jobs and topics

Tell us about your team and we'll walk you through setup, from choosing jobs to your first skills check.