Initial commit. Working and linked on PSGallery

This commit is contained in:
2026-05-15 08:53:21 +08:00
commit 7c77363885
17 changed files with 1109 additions and 0 deletions

21
Public/Get-UnifiSite.ps1 Normal file
View File

@@ -0,0 +1,21 @@
function Get-UnifiSite {
[CmdletBinding()]
param()
if (-not $script:UnifiSession) {
Write-Error "Not connected. Run Connect-UnifiController first."
return
}
$result = Invoke-UnifiRequest -Endpoint '/api/self/sites'
if (-not $result.data -or $result.data.Count -eq 0) {
Write-Warning "No sites returned."
return
}
$result.data | Select-Object `
@{ N = 'SiteId'; E = { $_.name } },
@{ N = 'Description'; E = { $_.desc } },
@{ N = 'Role'; E = { $_.role } }
}