Repository navigation
Register‑ShpTool
Registers a PowerShell command as a user-defined tool for Invoke-Shp.
Register-ShpTool [-Command] <String> [[-ToolName] <String>] [[-Description] <String>] [-PassThru]
[-WhatIf] [-Confirm] [<CommonParameters>]
Exposes any PowerShell command (function, cmdlet, or alias) to the model as a callable tool. The command's parameter metadata is turned into a tool JSON schema, and the registration is held in a module-scoped registry that Invoke-Shp offers to the model alongside its built-in tools. When the model calls the tool, Invoke-Shp invokes the backing command with the supplied arguments and returns its output to the model.
Registered tools are session-scoped and opt-in: they exist only for the current PowerShell session and are offered only after you register them. Because a tool runs real PowerShell with your privileges, register only commands you trust and disable them (Invoke-Shp -DisableUserTools) for untrusted prompts. Re-registering the same name overwrites it.
Register-ShpTool -Command Get-Process
Lets the model call Get-Process as a tool in subsequent Invoke-Shp runs.
Register-ShpTool -Command Get-Weather -Description 'Get the weather for a city.'
Registers a custom function with an explicit description.
The command to expose (function, cmdlet, or alias). Mandatory. Accepts pipeline input.
Type: String
Parameter Sets: (All)
Aliases: Name
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseThe tool description shown to the model. Defaults to the command's help synopsis.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseReturn the registered tool record.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe tool name shown to the model. Defaults to the command name.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Clear-ShpChat
- Clear-ShpContext
- Clear-ShpRedactionPolicy
- Clear-ShpToolPolicy
- Clear-ShpUsage
- Compress-ShpChat
- ConvertTo-ShpAnnotation
- ConvertTo-ShpOtelTrace
- ConvertTo-ShpTokenCount
- Get-ShpChat
- Get-ShpChatCheckpoint
- Get-ShpContext
- Get-ShpContextReport
- Get-ShpCosineSimilarity
- Get-ShpCostEstimate
- Get-ShpDefault
- Get-ShpMcpServer
- Get-ShpModel
- Get-ShpModelName
- Get-ShpRedactionPolicy
- Get-ShpTool
- Get-ShpToolPolicy
- Get-ShpUsage
- Initialize-Shp
- Invoke-Shp
- Invoke-ShpBatch
- Invoke-ShpEval
- Invoke-ShpSubagent
- Register-ShpMcpServer
- Register-ShpTool
- Request-ShpEmbedding
- Resolve-ShpError
- Restore-ShpChat
- Save-ShpChat
- Select-ShpModel
- Set-ShpContext
- Set-ShpRedactionPolicy
- Set-ShpToolPolicy
- Start-ShpChat
- Test-ShpCiReadiness
- Unregister-ShpMcpServer
- Unregister-ShpTool