< Back

Get-IniFileSection

Wed Jan 15, 2020 2:03 am

NAME Get-IniFileSection



SYNOPSIS

Get a section from an Ini file.





SYNTAX

Get-IniFileSection [[-Name] <String>] [-Path] <String> [<CommonParameters>]





DESCRIPTION

Reads an Ini file, returning matching sections.



The ini file sections returned by this function includes an Extent property which describes the location of a

section within the file.





PARAMETERS

-Name <String>

The name of the field to retrieve. The Name parameter supports wildcards. By default, all fields are returned.



Required? false

Position? 1

Default value *

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

The path to an ini file.



Required? true

Position? 2

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Management.Automation.PSObject





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-IniFileItem -Path somefile.ini



Get all sections in somefile.ini.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-IniFileSection -Name somesection -Path somefile.ini



Get the section named "somesection" from somefile.ini.











RELATED LINKS