< Back

Get-PolicyFileEntry

Sat Jan 18, 2020 7:23 pm

NAME Get-PolicyFileEntry



SYNOPSIS

Retrieves the current setting(s) from a .pol file.





SYNTAX

Get-PolicyFileEntry [-Path] <String> [-Key] <String> [-ValueName] <String> [<CommonParameters>]



Get-PolicyFileEntry [-Path] <String> -All [<CommonParameters>]





DESCRIPTION

Retrieves the current setting(s) from a .pol file.





PARAMETERS

-Path <String>

Path to the .pol file that is to be read.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Key <String>

The registry key inside the .pol file that you want to read.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ValueName <String>

The name of the registry value. May be set to an empty string to read the default value of a key.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-All [<SwitchParameter>]

Switch indicating that all entries from the specified .pol file should be output, instead of searching for a

specific key / ValueName pair.



Required? true

Position? named

Default value False

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

None. This command does not accept pipeline input.





OUTPUTS

If the specified registry value is found, the function outputs a PSCustomObject with the following properties:

ValueName: The same value that was passed to the -ValueName parameter

Key: The same value that was passed to the -Key parameter

Data: The current value assigned to the specified Key / ValueName in the .pol file.

Type: The RegistryValueKind type of the specified Key / ValueName in the .pol file.

If the specified registry value is not found in the .pol file, the command returns nothing. No error is produced.





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



PS C:\\>Get-PolicyFileEntry -Path $env:systemroot\\system32\\GroupPolicy\\Machine\\registry.pol -Key

Software\\Policies\\Something -ValueName SomeValue



Reads the value of Software\\Policies\\Something\\SomeValue from the Machine admin templates of the local GPO.

Either returns an object with the data and type of this registry value (if present), or returns nothing, if not

found.









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



PS C:\\>Get-PolicyFileEntry -Path $env:systemroot\\system32\\GroupPolicy\\Machine\\registry.pol -All



Outputs all of the registry values from the local machine Administrative Templates











RELATED LINKS

Set-PolicyFileEntry

Remove-PolicyFileEntry

Update-GptIniVersion

about_RegistryValuesForAdminTemplates





CommonParameters : True

WorkflowCommonParameters : False

details : @{name=Remove-PolicyFileEntry; noun=; verb=}

Syntax : @{syntaxItem=System.Object[]}

parameters : @{parameter=System.Object[]}

inputTypes : @{inputType=}

returnValues : @{returnValue=}

aliases : None



remarks : None

alertSet :

description :

examples :

Synopsis :

Remove-PolicyFileEntry [-Path] <string> [-Key] <string> [-ValueName] <string>

[-NoGptIniUpdate] [-WhatIf] [-Confirm] [<CommonParameters>]



ModuleName : PolicyFileEditor

nonTerminatingErrors :

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

Name : Remove-PolicyFileEntry

Category : Function

Component :

Role :

Functionality :





CommonParameters : True

WorkflowCommonParameters : False

details : @{name=Set-PolicyFileEntry; noun=; verb=}

Syntax : @{syntaxItem=System.Object[]}

parameters : @{parameter=System.Object[]}

inputTypes : @{inputType=}

returnValues : @{returnValue=}

aliases : None



remarks : None

alertSet :

description :

examples :

Synopsis :

Set-PolicyFileEntry [-Path] <string> [-Key] <string> [-ValueName] <string> [-Data] <Object>

[-Type <RegistryValueKind>] [-NoGptIniUpdate] [-WhatIf] [-Confirm] [<CommonParameters>]



ModuleName : PolicyFileEditor

nonTerminatingErrors :

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

Name : Set-PolicyFileEntry

Category : Function

Component :

Role :

Functionality :