Skip to main content

Remove-ADTIniValue

SYNOPSIS

Opens an INI file and removes the specified key or section.

SYNTAX

Remove-ADTIniValue [-FilePath] <String> [-Section] <String> [[-Key] <String>] [-WhatIf] [-Confirm]
[<CommonParameters>]

DESCRIPTION

The Remove-ADTIniValue function opens an INI file and removes the specified key or section.

Please note that the INI file provided cannot have a byte order mark (BOM) present as the underlying Win32 API cannot process it correctly.

EXAMPLES

EXAMPLE 1

Remove-ADTIniValue -FilePath "$env:ProgramFilesX86\IBM\Notes\notes.ini" -Section 'Notes' -Key 'KeyFileName'

Removes the 'KeyFileName' key from the 'Notes' section of the 'notes.ini' file.

EXAMPLE 2

Remove-ADTIniValue -FilePath "$env:ProgramFilesX86\IBM\Notes\notes.ini" -Section 'Notes'

Removes the entire 'Notes' section of the 'notes.ini' file.

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: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
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

None

This function does not return any output.

NOTES

An active ADT session is NOT required to use this function.

This function supports the -WhatIf and -Confirm parameters for testing changes before applying them.

Tags: psadt
Website: https://psappdeploytoolkit.com
Copyright: (C) 2026 PSAppDeployToolkit Team (Sean Lillis, Dan Cunningham, Muhammad Mashwani, Mitch Richters, Dan Gough).
License: https://opensource.org/license/lgpl-3-0

https://psappdeploytoolkit.com/docs/reference/functions/Remove-ADTIniValue

https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/blob/main/src/PSAppDeployToolkit/Public/Remove-ADTIniValue.ps1