Files
QAPI/PS1/getrepos.ps1
2026-05-16 23:42:06 +02:00

25 lines
780 B
PowerShell

# Définir l'URL de l'API
$apiUrl = "https://localhost/action/getrepos"
$apiKey = "TOKEN"
# Ignorer les erreurs de certificat SSL non valide
Add-Type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
# Envoyer la requête GET à l'API
$response = Invoke-RestMethod -Uri $apiUrl -Method Get -Headers @{ "x-api-key" = $apiKey }
# Afficher la réponse de l'API
$response | Format-List