liveBook · Manning

ConvertFrom-StringData

As explained in Practical Automation with PowerShell: Effective scripting from the console to the cloud

ConvertFrom-StringData is a PowerShell cmdlet that converts key-value text into a hashtable.

ConvertFrom-StringData converts text written as key=value pairs into a PowerShell hashtable. Pipeline file content into it when a configuration file already uses this format, then access values by property name. section 14.1.2

Reading Linux operating-system data

The /etc/os-release file can be read and converted directly: $OS = Get-Content -Path /etc/os-release | ConvertFrom-StringData. Access $OS.PRETTY_NAME afterward; remove embedded quotation marks with Replace when necessary.

How Practical Automation with PowerShell: Effective scripting from the console to the cloud covers it

How deep it goes
Explains the key=value format, pipeline usage, hashtable result, property access, and quote cleanup without covering cmdlet internals.
Examples
Uses Ubuntu /etc/os-release content, PRETTY_NAME access, and quote removal inside Get-SystemInfo.
What it assumes
Assumes familiarity with PowerShell pipelines, Get-Content, and property access while demonstrating the conversion pattern directly.
What you can do after
Apply it via PowerShell pipelines to turn compatible configuration text into a hashtable for subsequent property-based processing.
How it connects
Connects file reading with Get-Content, hashtable access, and the analogous ConvertFrom-Json conversion pattern.

This explainer was generated by Manning's knowledge graph from the text of Practical Automation with PowerShell: Effective scripting from the console to the cloud. The section links point to the parts of the book it draws on.