11 lines
569 B
PowerShell
11 lines
569 B
PowerShell
function Get-SamsaraRoles {
|
|
param($Result)
|
|
Invoke-SamsaraRead $Result 'Server roles and features' {
|
|
$Result.data = @(Get-WindowsFeature -ErrorAction Stop | Where-Object { $_.Installed } | ForEach-Object {
|
|
[pscustomobject]@{ name = [string]$_.Name; display_name = [string]$_.DisplayName
|
|
state = [string]$_.InstallState; feature_type = [string]$_.FeatureType }
|
|
})
|
|
}
|
|
$Result.limitations += 'Installed roles/features only; installed state does not prove current use. Requires local ServerManager availability.'
|
|
}
|