< Back

Get-IniFileItem

Wed Jan 15, 2020 2:02 am

NAME Get-IniFileItem



SYNOPSIS

Get an item from an Ini file.





SYNTAX

Get-IniFileItem [[-Name] <String>] [[-Section] <String>] -Path <String> [<CommonParameters>]



Get-IniFileItem [[-Name] <String>] [[-Section] <String>] -Path <String> -Value <String> [<CommonParameters>]



Get-IniFileItem [[-Name] <String>] [[-Section] <String>] -Path <String> -LiteralValue <String> [<CommonParameters>]





DESCRIPTION

Reads an Ini file, returning matching items.



The ini file items returned by this function include an Extent property which describes the location of an item

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? 2

Default value *

Accept pipeline input? false

Accept wildcard characters? false



-Section <String>

The section a setting resides within. The Section parameter supports wildcrds. By default, all sections are

returned.



Required? false

Position? 3

Default value *

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

The path to an ini file.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Value <String>

The value may be defined to describe the item. Wildcards are supported.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LiteralValue <String>

The literal value may be defined to absolutely describe the item. Wildcards are not supported.



Required? true

Position? named

Default value

Accept pipeline input? false

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 items in somefile.ini.









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



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



Get all items within the second "somesection" from somefile.ini.









-------------------------- EXAMPLE 3 --------------------------



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



Get all items named somename from any section.











RELATED LINKS