-
Notifications
You must be signed in to change notification settings - Fork 14
ConvertTo ToolFormat
dfinke edited this page Apr 20, 2024
·
2 revisions
Converts an array of functions into a tool format.
ConvertTo-ToolFormat [[-functions] <Hashtable[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
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.
$functions = @(
@{
Name = 'Get-User'
Description = 'Retrieves user information'
Parameters = @(
@{
Name = 'Username'
Type = 'String'
Description = 'The username of the user'
}
)
}
)
ConvertTo-ToolFormat -functions $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
{{ 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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.