Add local Windows Server inventory collection and validation; include core package
This commit is contained in:
10
powershell/Get-ServerRoles.ps1
Normal file
10
powershell/Get-ServerRoles.ps1
Normal file
@@ -0,0 +1,10 @@
|
||||
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.'
|
||||
}
|
||||
Reference in New Issue
Block a user