Skip to content

ConvertTo ToolFormat

dfinke edited this page Apr 20, 2024 · 2 revisions

ConvertTo-ToolFormat

SYNOPSIS

Converts an array of functions into a tool format.

SYNTAX

ConvertTo-ToolFormat [[-functions] <Hashtable[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The ConvertTo-ToolFormat function takes an array of functions and converts them into a tool format. Each function in the array is transformed into a hashtable with a 'type' key set to 'function' and a 'function' key set to the original function.

EXAMPLES

EXAMPLE 1

$functions = @(
    @{
        Name = 'Get-User'
        Description = 'Retrieves user information'
        Parameters = @(
            @{
                Name = 'Username'
                Type = 'String'
                Description = 'The username of the user'
            }
        )
    }
)

ConvertTo-ToolFormat -functions $functions

PARAMETERS

-functions

An array of hashtables representing functions.

Type: Hashtable[]
Parameter Sets: (All)
Aliases:

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

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

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

RELATED LINKS

Clone this wiki locally