Update TGBeta.ps1

This commit is contained in:
2025-01-28 00:28:13 -05:00
parent a3bf8e7840
commit c36daddcb2

View File

@@ -217,45 +217,10 @@ function Install-DattoRMM-Helper {
}
}
}
# Add below or near Install-DattoRMM-Helper
function Fetch-Sites {
param (
[string]$ApiUrl = "https://example.com/api/sites", # Replace with your actual API URL
[string]$ApiKey = "YourAPIKey", # Replace with your actual API Key
[string]$ApiSecretKey = "YourSecretKey" # Replace with your actual Secret Key
)
# Check if Install-DattoRMM exists
if (-not (Get-Command -Name Install-DattoRMM -CommandType Function -ErrorAction SilentlyContinue)) {
Write-Host "Install-DattoRMM function not found. Using helper function." -ForegroundColor Yellow
# Use the helper function
$sites = Install-DattoRMM-Helper -ApiUrl $ApiUrl -ApiKey $ApiKey -ApiSecretKey $ApiSecretKey -FetchSitesOnly
}
else {
Write-Host "Using the existing Install-DattoRMM function." -ForegroundColor Green
# Use the existing function
$sites = Install-DattoRMM -ApiUrl $ApiUrl -ApiKey $ApiKey -ApiSecretKey $ApiSecretKey -FetchSitesOnly
}
# Handle the fetched sites
if ($sites) {
Write-Host "Fetched Sites:" -ForegroundColor Cyan
$sites | ForEach-Object {
Write-Host "Site Name: $($_.Name), Site UID: $($_.UID)"
}
}
else {
Write-Host "Failed to fetch sites. Please check your API credentials or connection." -ForegroundColor Red
}
}
#endregion
#region SVS Module
function Install-SVSMSP {