From a6f55f6ee9111e70ef10a5b1d0b632fcc1f2c261 Mon Sep 17 00:00:00 2001 From: Rain Sallow Date: Mon, 28 Apr 2025 11:27:17 -0400 Subject: [PATCH] (#1074) Add docs for Get-ChocolateyConfigValue --- .../cmdlets/Get-ChocolateyConfigValue.mdx | 93 +++++++++++++++++++ .../docs/en-us/create/cmdlets/index.mdx | 2 +- .../functions/get-chocolateyconfigvalue.mdx | 85 ----------------- 3 files changed, 94 insertions(+), 86 deletions(-) create mode 100644 src/content/docs/en-us/create/cmdlets/Get-ChocolateyConfigValue.mdx delete mode 100644 src/content/docs/en-us/create/functions/get-chocolateyconfigvalue.mdx diff --git a/src/content/docs/en-us/create/cmdlets/Get-ChocolateyConfigValue.mdx b/src/content/docs/en-us/create/cmdlets/Get-ChocolateyConfigValue.mdx new file mode 100644 index 00000000000..4c37477870a --- /dev/null +++ b/src/content/docs/en-us/create/cmdlets/Get-ChocolateyConfigValue.mdx @@ -0,0 +1,93 @@ +--- +description: Information on Get-ChocolateyConfigValue function +external help file: Chocolatey.PowerShell.dll-Help.xml +Module Name: Chocolatey.PowerShell +online version: +order: 30 +schema: 2.0.0 +title: Get-ChocolateyConfigValue +xref: get-chocolateyconfigvalue +--- +import Xref from '@components/Xref.astro'; + +# Get-ChocolateyConfigValue + +## SYNOPSIS +Retrieves a named configuration value from the Chocolatey Configuration file. + +## SYNTAX + +``` +Get-ChocolateyConfigValue -Name [-IgnoredArguments ] [] +``` + +## DESCRIPTION +This cmdlet will retrieve the configuration value specified by the `-Name` parameter from the Chocolatey configuration file. +Sensitive configuration values (for example: `proxyPassword`) will remain in encrypted form when retrieved. + +Configuration entries are retrieved by case-insensitive comparison of the name (`key` attribute) in the configuration file. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ChocolateyConfigValue -Name cacheLocation +``` + +Outputs the cacheLocation from the Chocolatey configuration file. + +### Example 2 +```powershell +PS C:\> Get-ChocolateyConfigValue -ConfigKey cacheLocation +``` + +Outputs the cacheLocation from the Chocolatey configuration file. + +## PARAMETERS + +### -IgnoredArguments +Allows splatting with arguments that do not apply. Do not use directly. + +```yaml +Type: Object[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the configuration value to retrieve. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: ConfigKey + +Required: True +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](http://go.microsoft.com/fwlink/?LinkID=113216). + +## OUTPUTS + +### System.String + +## NOTES + +Available in 2.1.0+ + +## RELATED LINKS + + + + \ No newline at end of file diff --git a/src/content/docs/en-us/create/cmdlets/index.mdx b/src/content/docs/en-us/create/cmdlets/index.mdx index 437840774a1..4871e29a1d4 100644 --- a/src/content/docs/en-us/create/cmdlets/index.mdx +++ b/src/content/docs/en-us/create/cmdlets/index.mdx @@ -21,6 +21,7 @@ Keep in mind Chocolatey's automation scripts are just PowerShell, so you can do ## Complete List (alphabetical order) + * * * * @@ -28,4 +29,3 @@ Keep in mind Chocolatey's automation scripts are just PowerShell, so you can do * * * - \ No newline at end of file diff --git a/src/content/docs/en-us/create/functions/get-chocolateyconfigvalue.mdx b/src/content/docs/en-us/create/functions/get-chocolateyconfigvalue.mdx deleted file mode 100644 index 530478d93f7..00000000000 --- a/src/content/docs/en-us/create/functions/get-chocolateyconfigvalue.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -order: 30 -xref: get-chocolateyconfigvalue -title: Get-ChocolateyConfigValue -description: Information on Get-ChocolateyConfigValue function ---- -import Xref from '@components/Xref.astro'; - -# Get-ChocolateyConfigValue - -{/* This documentation is automatically generated from https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/Get-ChocolateyConfigValue.ps1 using https://github.com/chocolatey/choco/blob/master/GenerateDocs.ps1. Contributions are welcome at the original location(s). */} - -Retrieve a value from the Chocolatey Configuration file - -## Syntax - -~~~powershell -Get-ChocolateyConfigValue ` - -ConfigKey ` - [-IgnoredArguments ] [] -~~~ - -## Description - -This function will attempt to retrieve the path according to the specified Path Type -to a valid location that can be used by maintainers in certain scenarios. - -## Notes - -Available in 2.1.0+ - -## Aliases - -None - -## Examples - - **EXAMPLE 1** - -~~~powershell - -$value = Get-ChocolateyConfigValue -configKey 'cacheLocation' -~~~ - -## Inputs - -None - -## Outputs - -None - -## Parameters - -### -ConfigKey <String> -Property | Value ----------------------- | ----- -Aliases | -Required? | true -Position? | 1 -Default Value | -Accept Pipeline Input? | false - -### -IgnoredArguments [<Object[]>] -Property | Value ----------------------- | ----- -Aliases | -Required? | false -Position? | 2 -Default Value | -Accept Pipeline Input? | false - -### <CommonParameters> - -This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see `about_CommonParameters` http://go.microsoft.com/fwlink/p/?LinkID=113216 . - - - - - -> :choco-info: **NOTE** -> -> This documentation has been automatically generated from `Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Get-ChocolateyConfigValue -Full`. - -View the source for [Get-ChocolateyConfigValue](https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/Get-ChocolateyConfigValue.ps1)