30 lines
724 B
PowerShell
30 lines
724 B
PowerShell
function Format-MissingAction {
|
|
[CmdletBinding()]
|
|
[OutputType([hashtable])]
|
|
param (
|
|
[array]$missingActions
|
|
)
|
|
|
|
$actionGroups = @{
|
|
"Admin" = @()
|
|
"Delegate" = @()
|
|
"Owner" = @()
|
|
}
|
|
|
|
foreach ($action in $missingActions) {
|
|
if ($action -match "(Admin|Delegate|Owner) action '([^']+)' missing") {
|
|
$type = $matches[1]
|
|
$actionName = $matches[2]
|
|
$actionGroups[$type] += $actionName
|
|
}
|
|
}
|
|
|
|
$formattedResults = @{
|
|
Admin = $actionGroups["Admin"] -join ', '
|
|
Delegate = $actionGroups["Delegate"] -join ', '
|
|
Owner = $actionGroups["Owner"] -join ', '
|
|
}
|
|
|
|
return $formattedResults
|
|
}
|