Public/Get-P1LegacyRole.ps1
function Get-P1LegacyRole { <# .Synopsis Get PlannerOne legacy role list and information. .Description Return the PlannerOne legacy (version < 5.1) role informations #> [cmdletbinding()] param( [string] $Role ) Process { $roleConfigPath = Get-LegacyRolePath if (Test-Path $roleConfigPath) { Write-Verbose "Reading $roleConfigPath" [xml] $Roles = Get-Content $roleConfigPath if ($Role) { return $Roles.ArrayOfKeyValueOfstringServiceInstallKuH_Pi4Ow.KeyValueOfstringServiceInstallKuH_Pi4Ow.Value | where { $_.Role -eq $Role } } else { return $Roles.ArrayOfKeyValueOfstringServiceInstallKuH_Pi4Ow.KeyValueOfstringServiceInstallKuH_Pi4Ow.Value } } else { Write-Warning "No legacy role definition found at $roleConfigPath" } } } |