PowerShell module for FleetDM API integration
Invokes a custom FleetDM API method
Invoke-FleetDMMethod [-Endpoint] <String> [[-Method] <String>] [[-Body] <Hashtable>]
[[-QueryParameters] <Hashtable>] [-FollowPagination] [-Raw] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Provides direct access to any FleetDM API endpoint not covered by specific cmdlets. This is useful for accessing new or undocumented API endpoints.
Invoke-FleetDMMethod -Endpoint "config" -Method GET
Gets the FleetDM configuration
Invoke-FleetDMMethod -Endpoint "users" -Method GET -QueryParameters @{query = "admin"}
Searches for users with “admin” in their name
$body = @{
name = "New Team"
description = "Created via API"
}
Invoke-FleetDMMethod -Endpoint "teams" -Method POST -Body $body
Creates a new team
Invoke-FleetDMMethod -Endpoint "hosts/123/refetch" -Method POST
Triggers a refetch for host ID 123
Invoke-FleetDMMethod -Endpoint "labels" -Method GET -FollowPagination
Gets all labels, automatically following pagination
The API endpoint path (without /api/v1/fleet/ prefix)
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The HTTP method to use (GET, POST, PUT, PATCH, DELETE)
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: GET
Accept pipeline input: False
Accept wildcard characters: False
The request body as a hashtable (will be converted to JSON)
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Query parameters as a hashtable
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Automatically follow pagination to retrieve all results (for GET requests)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Return the raw response object without processing
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
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.