Sync-Parameter

SYNOPSIS

Synchronise cmdlet parameters with a hashtable

SYNTAX

Sync-Parameter [-Command] <Object> [[-Parameters] <Hashtable>] [<CommonParameters>]

DESCRIPTION

EXAMPLES

Example 1

PS C:\> $parma = Sync-Parameter -Command (Get-Command New-Item) -Parameters $PSBoundParameters
PS C:\> New-Item @parma

Grabs all valid parameters for New-Item from the PSBoundParameters collection in order to splat them to New-Item

PARAMETERS

-Command

The CommandInfo or FunctionInfo object

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Parameters

The parameter hashtable

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
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.

INPUTS

OUTPUTS

NOTES