SC-401 · PowerShell 101 · All skill areas

PowerShell for SC-401: read it, pick it, order it

The exam never asks you to type PowerShell. It shows you a command with gaps. You pick the cmdlet, the parameter or the value from a drop-down. Or you drag commands into order.

So you need three skills. Read a cmdlet name. Know which shell runs it. Know which look-alike is the trap.

Tags: EXAM = tested, learn it. SKIM = context, read once. Every question tests EXAM parts only.

The idea that holds the whole page

The noun tells you the product. The verb tells you the action.

Example: Set-RetentionCompliancePolicy. The verb is Set: change something that exists. The noun is RetentionCompliancePolicy: a Purview retention policy.

Most drop-down traps keep the verb and swap the noun. Set-RetentionPolicy looks the same. It is a different product: Exchange messaging records management (MRM).

A

EXAMThe verbs you meet

VerbMeansExam example
GetRead. Changes nothing.Get-RetentionCompliancePolicy
NewCreate a new object.New-OMEConfiguration
SetChange an object that exists.Set-IRMConfiguration
RemoveDelete an object.Remove-OMEConfiguration
TestCheck that a setup works.Test-IRMConfiguration
EnableTurn on a feature. Often one time only.Enable-ComplianceTagStorage
Connect / ImportOpen a session / load a module.Connect-IPPSSession, Import-Module
Start / Install / UpdateRun, install or upgrade (scanner).Start-Scan, Install-Scanner
ExecuteRare verb. Runs a one-off job.Execute-AzureADLabelSync
Decision rule. The stem says the object "already exists" → Set (or Update). The stem says "create" → New. The stem says "verify" or "find" → Get or Test.
B

EXAMParameters and values

A parameter starts with a dash. Its value follows it.

Set-Mailbox "Jane Doe" -RetentionHoldEnabled $true
            ^ who      ^ parameter            ^ value
You seeIt means
-Identity "Locked Policy"Which object to change. Often you can leave the word -Identity out and just give the name.
$true / $falseYes / no. Always with a $.
-AzureRMSLicensingEnabled:$TrueSame as -AzureRMSLicensingEnabled $true. The colon form is just another way to write it. Case does not matter.
-UserIds a@x.com,b@x.comA list. Commas between values.
@{Name="Credit Card Number"; minCount="1"}A hashtable: name = value pairs in @{ }. Used for SIT conditions and advanced settings.
-AdvancedSettings @{color="#FF0000"}A setting that has no box in the portal. Sent as a hashtable.
C

EXAMVariables, pipeline and files

You seeIt means
$Cred = Get-CredentialAsk for a user name and password. Keep them in the variable $Cred. Then -Credential $Cred uses them. Works for accounts without multifactor authentication (MFA).
$x = Get-Mailbox ... then $x.DistinguishedNameKeep the object. Then read one property from it with a dot.
Get-IRMConfiguration | fl AzureRMSLicensingEnabledThe pipe | sends the output to the next command. fl is Format-List: show that property as a list. It changes nothing.
| Where-Object { $_.DisplayName -eq "Group.Unified" }Keep only the items that match. $_ is "the current item".
[System.IO.File]::ReadAllBytes('C:\form.docx')Read a file as bytes. Cmdlets with -FileData want the bytes, not the path.
ConvertTo-SecureString 'P@ss' -AsPlainText -ForceTurn a typed password into the secure type that -Password needs.
D

Check yourself