$Destination = "C:\Source"
$Container = $true
$Recurse = $false
$Force = $false
$ArrParamList = [PSCustomObject]@{
'Path' = $Source
'Destination' = $Destination
'Filter' = $Filter
'Container' = $Container
'Include' = $Include
'Exclude' = $Exclude
'Recurse' = $Recurse
'Force' = $Force
}
New-BluGenieCommand -Name 'Copy-Item' -BoundParameters $ArrParamList -ErrorAction SilentlyContinue
$NewCommand.Invoke()
This will dynamically build out the Copy-Item string from the variables defined (normally $PSBoundParameters from the parent script)
and invoke the command.
PARAMETERS
Name
-Name <String>
The name of the command [cmdlet] you're building the string for.
<Type>String<Type>
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
BoundParameters
-BoundParameters <Object>
[PSCustomObject] with all the parameters needed to build the new cmdlet / command
<Type>String<Type>
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
Walkthrough
-Walkthrough [<SwitchParameter>]
An automated process to walk through the current function and all the parameters
<Type>SwitchParameter<Type>
Required? false
Position? 3
Default value False
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.