> For the complete documentation index, see [llms.txt](https://manuals.blusapphire.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manuals.blusapphire.io/blugenie/full-function-list/new-blugeniecommand.md).

# New-BluGenieCommand

﻿

### New-BluGenieCommand <a href="#new-blugeniecommand" id="new-blugeniecommand"></a>

### SYNOPSIS <a href="#synopsis" id="synopsis"></a>

New-BluGenieCommand will take a list of arguments and build out a command line string for \[ScriptBlock] execution

### SYNTAX <a href="#syntax" id="syntax"></a>

```
New-BluGenieCommand [[-Name] <String>] [[-BoundParameters] <Object>] [[-Walkthrough]] [<CommonParameters>]
```

### DESCRIPTION <a href="#description" id="description"></a>

New-BluGenieCommand will take a list of arguments and build out a command line string for \[ScriptBlock] execution

The advantage of this script is to take arguments from the parent functions $PSBoundParameters and use them to execute nested cmdlets

### EXAMPLES <a href="#examples" id="examples"></a>

#### EXAMPLE 1 <a href="#example-1" id="example-1"></a>

```
$Source = "$ScriptDirectory\Tools\SysinternalsSuite"
```

```
$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 <a href="#parameters" id="parameters"></a>

#### Name <a href="#name" id="name"></a>

```
-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 <a href="#boundparameters" id="boundparameters"></a>

```
-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 <a href="#walkthrough" id="walkthrough"></a>

```
-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 <a href="#commonparameters" id="commonparameters"></a>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
