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. For more information, see about_CommonParameters.
Links
NOTE: This documentation has been automatically generated using:
$extensionPath = Join-Path $env:ChocolateyInstall 'extensions\veeam'
Import-Module (Join-Path $extensionPath 'veeam.psm1') -Force
Get-Help Add-SilentArgument -Full
View the source for Add-SilentArgument