Created
August 17, 2017 16:52
-
-
Save ryancbutler/90f201df7381b7ea779c22acb38218ec to your computer and use it in GitHub Desktop.
Converts Citrix Policy to easily readable PS object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Converts Citrix Policy to easily readable PS object | |
function Get-CTXPolObj ($pol) | |
{ | |
$temp = @() | |
foreach ($settings in $pol) | |
{ | |
foreach($setting in $settings.psobject.properties) | |
{ | |
$Object = New-Object PSObject | |
$Object | add-member -MemberType NoteProperty -Name "Setting" -Value $setting.Name | |
foreach($prop in ($setting.value).psobject.properties) | |
{ | |
$Object | add-member -MemberType NoteProperty -Name $prop.Name -Value $prop.Value | |
} | |
$temp += $Object | |
} | |
} | |
return $temp | |
} | |
$pol = Get-CtxGroupPolicyConfiguration -PolicyName "TestPOL" | |
$polobj = Get-CTXPolObj $pol | |
$polobj|Where-Object{$_.state -eq "Enabled"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment