> 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).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://manuals.blusapphire.io/blugenie/full-function-list/new-blugeniecommand.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
