Automation · PowerShell Automation
CSV
Cheat sheet · https://pcornel.dk/topic.php?topic=5253
Answer
PowerShell handles CSV with Import-Csv, which turns rows into objects with properties from the header, and Export-Csv -NoTypeInformation for reports.
Remember
- Import-Csv returns objects with header names as properties.
- Export-Csv -NoTypeInformation writes clean files.
- Set -Delimiter and -Encoding explicitly.
First checks
Import-Csv f.csv -Delimiter ';'— importExport-Csv out.csv -NoTypeInformation -Encoding utf8— export- Required columns validation — input checks
Verify in this order
CSV → Import-Csv → objects → validation
Where it usually breaks
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.
CSV · PowerShell operational reference
| Boundary | CSV reference |
|---|---|
| Runtime identity | PowerShell edition/version + command/module source |
| Persistent intent | Script/module/config prerequisites under source control |
| Verification | Read-only discovery → execution evidence → independent target read-back |
| Output contract | Structured objects/streams before formatting |
| Failure boundary | Separate engine/binding from transport/API/native and target-state failures |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5253