Skip to main content

Get-IniValue

SYNOPSISโ€‹

Parses an INI file and returns the value of the specified section and key.

SYNTAXโ€‹

Get-IniValue [-FilePath] <String> [-Section] <String> [-Key] <String> [[-ContinueOnError] <Boolean>]
[<CommonParameters>]

DESCRIPTIONโ€‹

Parses an INI file and returns the value of the specified section and key.

EXAMPLESโ€‹

EXAMPLE 1โ€‹

Get-IniValue -FilePath "$envProgramFilesX86\IBM\Notes\notes.ini" -Section 'Notes' -Key 'KeyFileName'

PARAMETERSโ€‹

-FilePathโ€‹

Path to the INI file.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Sectionโ€‹

Section within the INI file.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Keyโ€‹

Key within the section of the INI file.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ContinueOnErrorโ€‹

Continue if an error is encountered. Default is: $true.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: True
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersโ€‹

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTSโ€‹

Noneโ€‹

You cannot pipe objects to this function.โ€‹

OUTPUTSโ€‹

System.Stringโ€‹

Returns the value of the specified section and key.โ€‹

NOTESโ€‹

https://psappdeploytoolkit.com