PowerShell module for FleetDM API integration
Establishes a connection to the FleetDM API
Connect-FleetDM -BaseUri <String> -ApiToken <SecureString> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Connect-FleetDM -BaseUri <String> -Credential <PSCredential> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Connects to a FleetDM instance using either an API token or email/password credentials. The connection is stored at the module level and used by all other FleetDM cmdlets.
$token = ConvertTo-SecureString "your-api-token" -AsPlainText -Force
Connect-FleetDM -BaseUri "https://fleet.example.com" -ApiToken $token
Connects to FleetDM using an API token
$cred = Get-Credential
Connect-FleetDM -BaseUri "https://fleet.example.com" -Credential $cred
Prompts for credentials and connects to FleetDM
Connect-FleetDM -BaseUri "https://fleet.example.com" -ApiToken (Read-Host -AsSecureString "Enter API Token")
Prompts for API token securely and connects to FleetDM
The base URI of your FleetDM instance (e.g., https://fleet.example.com)
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A secure string containing the FleetDM API token. This is the preferred method for automation and API-only users.
Type: SecureString
Parameter Sets: Token
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
PSCredential object containing email and password for FleetDM authentication. Use this for interactive sessions or when token authentication is not available.
Type: PSCredential
Parameter Sets: Credential
Aliases:
Required: True
Position: Named
Default value: None
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.
https://fleetdm.com/docs/using-fleet/rest-api#authentication