Chocolatey Packages

Documentation about My Chocolatey Packages.

View project on GitHub

Add-SilentArgument

Adds a trimmed installer argument to a buffer when it is non-empty.

Syntax

Add-SilentArgument `
  [-Buffer <List`1>] `
  [-Value <String>] [<CommonParameters>]

Description

Ensures a valid buffer is provided, ignores null/whitespace values, trims the input, and appends it to the supplied List[string]. Useful when building Chocolatey silent argument lists conditionally.

Aliases

None

Examples

EXAMPLE 1


$silentArgs = New-Object System.Collections.Generic.List[string]
Add-SilentArgument -Buffer $silentArgs -Value '/qn'
Add-SilentArgument -Buffer $silentArgs -Value ("INSTALLDIR=`"{0}`"" -f $pp.installDir)

Inputs

None

Outputs

None

Parameters

-Buffer [<List`1>]

A System.Collections.Generic.List[string] to append arguments to.

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

-Value [<String>]

The argument text to add when not null or whitespace.

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 Add-SilentArgument -Full.

View the source for Add-SilentArgument