From 4e92a71838194874160dd1a66ec6f72f75bf38bf Mon Sep 17 00:00:00 2001 From: Rain Sallow Date: Fri, 7 Mar 2025 12:03:42 -0500 Subject: [PATCH] (#1074) Add docs for Get-ChocolateyPath --- .../create/cmdlets/Get-ChocolateyPath.mdx | 96 +++++++++++++++++++ .../docs/en-us/create/cmdlets/index.mdx | 2 +- .../create/functions/get-chocolateypath.mdx | 66 ------------- 3 files changed, 97 insertions(+), 67 deletions(-) create mode 100644 src/content/docs/en-us/create/cmdlets/Get-ChocolateyPath.mdx delete mode 100644 src/content/docs/en-us/create/functions/get-chocolateypath.mdx diff --git a/src/content/docs/en-us/create/cmdlets/Get-ChocolateyPath.mdx b/src/content/docs/en-us/create/cmdlets/Get-ChocolateyPath.mdx new file mode 100644 index 00000000000..685572f879e --- /dev/null +++ b/src/content/docs/en-us/create/cmdlets/Get-ChocolateyPath.mdx @@ -0,0 +1,96 @@ +--- +description: Information on Get-EnvironmentVariable cmdlet +external help file: Chocolatey.PowerShell.dll-Help.xml +Module Name: Chocolatey.PowerShell +online version: https://docs.chocolatey.org/en-us/create/cmdlets/get-chocolateypath +order: 40 +schema: 2.0.0 +title: Get-ChocolateyPath +xref: get-chocolateypath +--- +import Xref from '@components/Xref.astro'; + +# Get-ChocolateyPath + +## SYNOPSIS +Retrieve the paths available to be used by maintainers of packages. + +## SYNTAX + +``` +Get-ChocolateyPath [-PathType] [-IgnoredArguments ] [] +``` + +## DESCRIPTION +This function will attempt to retrieve the filesystem path corresponding to the chosen `-PathType` in a +valid location which may be used by package maintainers in certain scenarios. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ChocolateyPath -PathType InstallPath +``` + +Outputs the path to the Chocolatey installation directory. For example: `C:\ProgramData\chocolatey` + +### Example 1 +```powershell +PS C:\> Get-ChocolateyPath -PathType PackagePath +``` + +Outputs the path to the package folder. For example: `C:\ProgramData\chocolatey\lib\MyPackageName` + +## 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 +``` + +### -PathType +The type of path that should be looked up. +Available values are: +- `PackagePath` - The path to the the package that is being installed. Typically `C:\ProgramData\chocolatey\lib\` +- `InstallPath` - The path to where Chocolatey is installed. Typically `C:\ProgramData\chocolatey` + +```yaml +Type: ChocolateyPathType +Parameter Sets: (All) +Aliases: Type +Accepted values: PackagePath, InstallPath + +Required: True +Position: 0 +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). + +## INPUTS + +### None + +## OUTPUTS + +### System.String +This function outputs the full path stored accordingly with specified path type. +If no path could be found, there is no output. + +## NOTES +Available in 1.2.0+. + +## RELATED LINKS diff --git a/src/content/docs/en-us/create/cmdlets/index.mdx b/src/content/docs/en-us/create/cmdlets/index.mdx index 437840774a1..bd4b65d15fd 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-chocolateypath.mdx b/src/content/docs/en-us/create/functions/get-chocolateypath.mdx deleted file mode 100644 index 079cc00193e..00000000000 --- a/src/content/docs/en-us/create/functions/get-chocolateypath.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -order: 40 -xref: get-chocolateypath -title: Get-ChocolateyPath -description: Information on Get-ChocolateyPath function ---- -import Xref from '@components/Xref.astro'; - -# Get-ChocolateyPath - -{/* This documentation is automatically generated from https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/Get-ChocolateyPath.ps1 using https://github.com/chocolatey/choco/blob/master/GenerateDocs.ps1. Contributions are welcome at the original location(s). */} - -Retrieve the paths available to be used by maintainers of packages. - -## Syntax - -~~~powershell -Get-ChocolateyPath ` - -PathType [] -~~~ - -## 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 1.2.0+. - -## Aliases - -None - -## Examples - - **EXAMPLE 1** - -~~~powershell - -$path = Get-ChocolateyPath -PathType 'PackagePath' -~~~ - -## Inputs - -None - -## Outputs - -None - -## Parameters - -### <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-ChocolateyPath -Full`. - -View the source for [Get-ChocolateyPath](https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/Get-ChocolateyPath.ps1)