Chocolatey Packages

Documentation about My Chocolatey Packages.

View project on GitHub

Invoke-PackageParameterValidation

Validates and normalizes Chocolatey package parameters based on simple rule types.

Syntax

Invoke-PackageParameterValidation `
  [-Parameters <Hashtable>] `
  [-Rules <Hashtable>] [<CommonParameters>]

Description

Checks supplied package parameters against a hashtable of rule names and types. Ensures required parameters are present, trims values, and normalizes booleans to ‘1’ or ‘0’. Throws descriptive errors when a parameter fails validation.

Aliases

None

Examples

EXAMPLE 1


$pp = Get-PackageParameters
$rules = @{
  installDir = 'Path'
  useSsl     = 'Boolean'
  retryCount = 'Integer'
}
Invoke-PackageParameterValidation -Parameters $pp -Rules $rules

Inputs

None

Outputs

None

Parameters

-Parameters [<Hashtable>]

Hashtable of parameters, typically the result of Get-PackageParameters. Values are updated in place when trimmed or normalized.

Property Value
Aliases  
Required? false
Position? 1
Default Value  
Accept Pipeline Input? false

-Rules [<Hashtable>]

Hashtable mapping parameter names to rule types. Supported types: ZeroOrOne, OneOrTwo, Path, String, Integer, Boolean.

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 .

[[Function Reference HelpersReference]]

NOTE: This documentation has been automatically generated from Import-Module "$env:ChocolateyInstalls\veeams\veeam.psm1" -Force; Get-Help Invoke-PackageParameterValidation -Full.

View the source for Invoke-PackageParameterValidation