Introduction
Scripts often need to reuse data from other sources. Most applications export data in formats such as CSV and XML. Windows PowerShell includes cmdlets to import data in these formats for use in your scripts. In this module, you'll learn how to import data from a text file, CSV file, XML file, and JavaScript Object Notation (JSON) file.
Learning objectives
After completing this module, you'll be able to:
- Describe how to use Get-Content to review file data.
- Describe how to use Import-Csv to retrieve data.
- Describe how to use Import-Clixml to import XML data.
- Describe how to use ConvertFrom-Json to work with JSON data.
Prerequisites
Familiarity with:
- Windows networking technologies and implementation
- Windows Server administration, maintenance, and troubleshooting
- Windows PowerShell and its commands to perform specific tasks
- PowerShell cmdlets used for system administration tasks related to Active Directory, network configuration, server administration, and Windows client device administration (Windows 10 and Windows 11)
- Windows PowerShell pipeline, PowerShell providers, and PowerShell drives
- CIM and WMI technologies
- The use of variables, arrays, and hash tables in Windows PowerShell