CogniSkill · PowerShell for Service Desk Automation
Content review copy. This does not replace the site theme. For SC-300, this preview shows additions; the existing teaching is retained on import.
What you will make
Design a read-only triage report that records evidence and refuses to equate ping failure with device failure.
What you need
PowerShell Foundations; use a writable practice folder.
Save as Triage.ps1 in PowerShell 7. All observations are simulated. Do not replace them with production probes until you have separately tested and approved the collector.
How to work through it
- Understand the mechanism and predict the result.
- Run or trace the fixture and preserve the evidence.
- Change the inputs, expose a failure and explain the repair.
- Complete a project and answer the retrieval questions.
Scope
A focused practical workshop, not a complete beginner-to-expert programme. Allow time for the exercises and project; the pace depends on your prior experience. Related CogniSkill books are optional next steps. No purchase is required.
Applied capability and learning route
Design a safe service-desk report that separates collection errors from actionable findings.
Follow the lessons in order: establish the model, trace the supplied evidence, attempt the case, compare the worked solution, and complete the changed-condition project. The target is intermediate reasoning within this stated scope, not mastery of the entire profession or product. If a prerequisite is unfamiliar, pause and use the linked foundational teaching before attempting the project.
All teaching, explained answers and core synthetic practice are free. Some operational labs require separately available software, a licensed test tenant or an authorized lab; offline completion does not claim hands-on product proficiency.
How to complete this course
Study the worked examples, attempt the exercises before opening solutions, and submit your own project notes. Completion records are self-reported; practical competence requires the stated verification.
Design the evidence object before the command
Your practical task
Design a read-only triage report that records evidence and refuses to equate ping failure with device failure.
A daily ticket export mixes lowercase and uppercase priorities. A script that matches one spelling misses incidents. Build an accurate report from synthetic tickets before considering any live service-desk integration.
How the system works
A service-desk script should narrow a support question before collecting data. Device reachability, name resolution and service availability are different checks. Ping may be blocked while an application remains available. A service name can resolve while the application behind it is failing. A good report stores separate observations and avoids a single healthy boolean that conceals these differences.
This lab separates the assessment function from collection. You can test how the report interprets evidence without contacting a machine. A production collector could provide DNS, ICMP and application-test results, but those integrations would need permission, environment-specific behaviour and timeouts. The training function does not claim to perform them.
The classifier has explicit UNKNOWN values. If the application check did not run, neither OK nor FAILED is justified. The recommended next action is tied to the missing or failing evidence. It is a handoff recommendation, not an automatic remediation instruction. A support script should not restart services or reset identities merely because an incomplete report contains a failure.
Design the evidence object before the command
A support script should answer a defined question using a consistent record. Choose fields such as Computer, ObservationTime, Target, Dns, Transport, Application, Source and CollectionError. Do not merge failed, unknown and not attempted into the same Boolean value.
A function that returns objects can support both human display and machine export. Formatting belongs at the presentation boundary: Format-Table creates formatting instructions, so it should not be piped into Export-Csv as though it were your business objects. Keep raw observations and derived classifications separate so an operator can challenge the classification.
Reasoning model
A support script should make incomplete evidence visible. “No rows returned” can mean no findings, inaccessible source or parsing failure. Use a stable record schema with status and reason, separate collection from decisions, and require deliberate authorization for any remediation. A preview mechanism is useful only when the modifying commands participate correctly; the presence of a switch name does not prove no changes can occur.
Official reference for further study
Trace conflicting evidence
Prepare the lab
Save as Triage.ps1 in PowerShell 7. All observations are simulated. Do not replace them with production probes until you have separately tested and approved the collector.
$ErrorActionPreference = 'Stop'
function Get-TriageResult {
param([pscustomobject]$Evidence)
$state = 'REVIEW'
$next = 'Check the application response and affected scope'
if ($Evidence.Application -eq 'OK') { $state = 'AVAILABLE'; $next = 'Investigate the reported workflow, not ping alone' }
elseif ($Evidence.Dns -eq 'FAILED') { $next = 'Verify name and DNS source before testing the endpoint' }
elseif ($Evidence.Application -eq 'UNKNOWN') { $state = 'INCOMPLETE'; $next = 'Collect application evidence' }
[pscustomobject]@{Computer=$Evidence.Computer; Dns=$Evidence.Dns; Ping=$Evidence.Ping; Application=$Evidence.Application; State=$state; NextAction=$next}
}
$cases = @(
[pscustomobject]@{Computer='LAB-A';Dns='OK';Ping='FAILED';Application='OK'},
[pscustomobject]@{Computer='LAB-B';Dns='FAILED';Ping='UNKNOWN';Application='UNKNOWN'},
[pscustomobject]@{Computer='LAB-C';Dns='OK';Ping='OK';Application='UNKNOWN'}
)
$report = @($cases | ForEach-Object { Get-TriageResult $_ })
$report | Format-List
if (($report.State -join ',') -ne 'AVAILABLE,REVIEW,INCOMPLETE') { throw 'Triage test failed' }
Work through the evidence
Define the support question
For LAB-A, the application answered but ping failed. State what you can establish: that application check was available at that time. You cannot establish that every workflow is healthy or that the device ignores all ICMP traffic.
Trace precedence
The first condition handles an application success before considering DNS. For a real collector, contradictory results must be investigated, including cached DNS or a different target. Priority in a classifier does not erase contradictory evidence.
Distinguish incomplete work
LAB-C has a ping response but no application result. INCOMPLETE communicates an untested layer. A completed network probe is not a completed application investigation.
Expected baseline result
Baseline states: AVAILABLE, REVIEW, INCOMPLETE. LAB-A must not be labelled offline merely because ping failed. The extended report must flag contradictory evidence rather than pretending it is consistent.
Trace conflicting evidence
The supplied classifier gives an application success precedence over ping failure. That is appropriate for its narrow question, but it does not make every lower-layer observation consistent. Add LAB-D with Dns=FAILED, Ping=UNKNOWN and Application=OK. Possible explanations include cached resolution, a different target or mismatched observation times.
Do not invent which explanation is true. Add a ConsistencyNote and require aligned target/time evidence before closure. The existing AVAILABLE result means that the supplied application test succeeded; rename it or explain its scope if readers could mistake it for complete device health.
Evidence laboratory — attempt before reading the solution
A fictional read-only inventory collects service state from four approved lab hosts. H1: service Agent running; H2: Agent stopped; H3: connection denied; H4: Agent not installed. The business rule is to report stopped installed agents for review, not restart automatically. Produce separate counts for confirmed stopped, collection failure and not installed. An existing script converts every exception into “Stopped” and reports three failures. Explain why that result is unsafe.
Official reference for further study
Exercise: validate rather than guess
Change the evidence
Add collection metadata
Add CheckedAtUTC, Target and CollectorVersion properties. A report without its time and target can be technically correct but unusable after a configuration change or when two teams test different endpoints.
Test contradictory data
Create a case with DNS FAILED and Application OK. The current classifier reports AVAILABLE because it prioritizes observed application success. Add a contradiction flag and describe possible causes; do not simply delete one observation.
Prepare a handoff
Write a ticket note with the user symptom, affected population, observations, interpretation and next owner. Include a reproducible target rather than saying checked network. Keep credentials and raw authentication tokens out of the report.
Diagnose failures
The script restarts a service after a ping failure
The remediation does not follow from the evidence. Return to read-only assessment and establish that the specific service is failing before proposing an approved action.
Results are stale when a ticket is escalated
Record timestamps and the collector version. Repeat only the checks relevant to the changed condition, then distinguish the new evidence from the original report.
A failure is converted into UNKNOWN without explanation
Preserve the collector error category. UNKNOWN should explain why no result is available: timeout, unsupported method, access denial, or a check not attempted.
A second worked example
$tickets = @(
[pscustomobject]@{Id=101;Priority=' high ';Owner='Ana'},
[pscustomobject]@{Id=102;Priority='Low';Owner='Ben'}
)
$tickets | Where-Object { $_.Priority.Trim().ToLowerInvariant() -eq 'high' } |
Select-Object Id, Owner | Export-Csv './high.csv' -NoTypeInformation
The comparison normalizes the priority for matching without rewriting the input objects. Ticket 101 is exported with Id and Owner. The relative output path is under the current directory, so run in a disposable practice folder. Inspect the CSV and confirm its row count before adding scheduling or a live ticket source.
Transfer exercise
Add a blank priority and a value Urgent. Explain how the report should handle them if only High and Low are approved categories.
Worked transfer answer
Flag both as invalid or unknown in a separate validation report instead of silently assuming Low. Protect the Trim call from null input if data can be missing. State the accepted categories and ensure every source row appears either in accepted processing or in the rejected-row count.
Exercise: validate rather than guess
A CSV row contains Application=SUCCESS instead of the declared OK/FAILED/UNKNOWN values. Should the classifier silently treat it as failure or success?
Worked reasoning
Neither. Validate each field against the input contract and return a clear invalid-data result or stop the report according to the specification. Unknown is a declared measurement state; an unexpected string is a schema/data problem. Keep the raw value and source row for correction. Add tests for an empty computer name and contradictory observations as separate failure classes.
Worked laboratory solution
Compare your reasoning with the worked solution
Only H2 is confirmed stopped. H3 has unknown service state because collection failed. H4 has a known absence, which may be expected or an inventory issue but is not a stopped installed service. The three cases require different owners and next steps. Return explicit fields such as Host, CollectionStatus, Installed, ServiceState and Reason rather than one misleading Boolean. Preserve a nonzero/error indication for collection failures in automation without discarding the successfully collected rows.
Official reference for further study
Workbook already downloaded
Build a reviewable service-desk runbook
Build your project
Extend the result with a Contradiction flag, CheckedAtUTC and NextOwner. Add four test cases covering application success with ping failure, DNS failure, incomplete application testing and contradictory DNS/application evidence. Produce a ticket-ready report without adding any remediation command.
What a complete result looks like
Triage follows the tested application workflow
The three baseline results are AVAILABLE, REVIEW and INCOMPLETE. Add a fourth row with successful DNS but failed application evidence and assign a named next owner. Include UTC observation time and the exact application transaction tested. Failed ping does not contradict a successful application transaction; unknown application state must remain incomplete.
Acceptance criteria
- Input/output counts reconcile
- Unknown priorities visible
- Output location explicit
- Only synthetic tickets used
Self-review record
Record your inputs, expected and actual outputs, failing test, correction, and remaining limitation. A reviewer should be able to reproduce your conclusion from your evidence. Compare your result with the lab baseline; explain any deliberate extension rather than simply copying its output.
Retrieval practice
Answer in your own words before opening each explanation. Use an example from the fixture to justify your answer.
Does ping failure prove an application outage?
Compare your reasoning
No. The application must be tested directly, and ICMP may be blocked.
What does INCOMPLETE mean?
Compare your reasoning
The defined question cannot be answered with the observations collected so far.
Why separate collector and classifier?
Compare your reasoning
Interpretation can be tested using controlled evidence without contacting or modifying production devices.
Build a reviewable service-desk runbook
Submit the three supplied baseline cases plus contradiction, missing measurement and invalid-enumeration cases. Include expected and actual classifications. Keep operational probes separate from the offline classifier; testing a classifier against synthetic records is not authorization to scan remote machines.
Your handoff should state which workflow was checked, the time and source, which layer remains untested and who owns escalation. If exporting shared reports, remove unnecessary identifiers and secrets. A script that runs without exceptions can still deliver an inaccurate diagnosis when its observations refer to different requests.
Transfer project — changed conditions
Write a read-only collector using mocked inputs first. Add a structured output file and a summary that reconciles all four hosts. Then design—but do not execute—a separate remediation stage that accepts only approved H2-like records, logs each decision and checks the postcondition. Include a stale-record test in which the service starts between collection and remediation. Explain how rechecking state prevents acting on an obsolete assumption.
Practical assessment rubric
Score each dimension 0–2: 0 = absent or materially incorrect; 1 = partly correct with an unresolved gap; 2 = correct, explicit and supported by the supplied evidence or an actual labeled lab result.
- Evidence/model: identify the relevant entities, inputs, assumptions and boundaries without inventing facts.
- Main result: derive the case-specific expected result, calculation or decision and show the intermediate reasoning.
- Failure/boundary: test the changed condition and explain why the original conclusion does or does not transfer.
- Verification: supply reproducible steps and expected/observed results; label manual traces as manual, not executed.
- Communication/safety: explain limitations, owners and a proportionate next action without unsafe or unnecessary access.
Target: at least 8/10, with no zero in main result or communication/safety. This is a local learning rubric, not an accredited certification standard. A written/manual solution demonstrates reasoning only; operational competence additionally requires the relevant executable lab in an authorized environment. The native multiple-choice score is separate and does not automatically grade this rubric.
Submission template
- My input/evidence and assumptions:
- Expected result with calculations or trace:
- My implementation/decision and justification:
- Changed-condition result:
- Observed execution, or explicitly labeled manual trace:
- Failure and recovery evidence:
- Unverified limitation and next action:
- Self-score with evidence for each dimension:
Remediation
If the main result is wrong, reconstruct the supplied case from the raw inputs before changing code or controls. If the boundary case is wrong, identify the assumption that changed and rerun both the original and changed case. If verification is missing, do not convert a prediction into an observed result. Reattempt the transfer task without copying the worked solution, then explain it to another person.
Official reference for further study
Assessment: explain your decisions
Choose an answer and write your reason before opening each explanation. Then explain why the other choices do not fit the evidence. Use missed questions to revisit the lesson. This knowledge check is only one part of assessment: complete the practical transfer project as well. It does not predict certification-exam success.
1. Which issue does normalization address?
- Equivalent spelling and whitespace
- Every missing value
- Authorization
Answer and explanation
Equivalent spelling and whitespace — Normalization handles defined equivalent representations.
2. What should happen to an unknown category?
- Silently become Low
- Be flagged for review
- Be deleted without a count
Answer and explanation
Be flagged for review — Unknown input should not be silently reinterpreted.
3. What makes a scheduled file output reliable?
- A remembered interactive folder
- Formatting first
- An explicit configured path
Answer and explanation
An explicit configured path — Scheduled execution may use another working directory.
4. Application=SUCCESS arrives under a contract allowing OK/FAILED/UNKNOWN. What should a collector do?
- Report invalid input rather than silently classify it
- Treat every unfamiliar value as OK
- Treat every unfamiliar value as a verified outage
Answer and explanation
Report invalid input rather than silently classify it — An unrecognized enumeration is a data-contract failure. Neither success nor failure is a supported observation.
5. Which pipeline preserves business objects for CSV export?
- Convert every object to an unstructured sentence first
- Send the result objects directly to Export-Csv
- Format-Table then Export-Csv
Answer and explanation
Send the result objects directly to Export-Csv — Formatting produces presentation records rather than the intended data objects. Keep formatting at the human display boundary.
6. DNS says failed but an application test says OK. What should the report retain?
- Only the preferred observation without explanation
- A definite root cause of stale cache
- Both observations with a consistency warning and target/time checks
Answer and explanation
Both observations with a consistency warning and target/time checks — The observations may use different contexts; cache is one hypothesis, not an established cause. Preserve evidence for reconciliation.
7. How many hosts are confirmed to have a stopped installed Agent?
- One: H2.
- Three: H2, H3 and H4.
- Four.
Answer and explanation
One: H2. — Connection denial leaves state unknown, and absence is not the same as stopped. Only H2 meets the rule.
8. What should H3’s report convey?
- The service is definitely healthy.
- Collection failed; service state is unknown.
- The service is definitely stopped.
Answer and explanation
Collection failed; service state is unknown. — An access error is evidence about collection, not the service’s actual state.
9. Why recheck H2 before an approved remediation?
- Reports never become stale.
- Rechecking guarantees every future run will succeed.
- Its state may have changed since collection.
Answer and explanation
Its state may have changed since collection. — The time gap creates a race. A precondition check reduces stale actions but does not guarantee future outcomes.
Use the explained questions above for offline practice. A scored attempt requires the course assessment on CogniSkill.ca.