Как мне go получить выходные данные IsSelected foreach из команды powershell для следующего кода xaml?
CheckedListBox содержит данные, заполненные нижней командой powershell.
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,0">
<ListBox x:Name="Deployment_Groups_ListBox" TabIndex="3" BorderThickness="1" Width="650" Height="268" HorizontalAlignment="Center" VerticalAlignment="Top"
ItemsSource="{Binding Items}"
SelectionMode="Multiple" BorderBrush="#FF41B1E1">
<ListBox.Resources>
<Style TargetType="ListBoxItem">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<CheckBox Margin="5,2"
IsChecked="{TemplateBinding IsSelected}">
<ContentPresenter />
</CheckBox>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Resources>
</ListBox>
</StackPanel>
Function Display_Deployment_Groups {
#Get Deployment group from script
$filterdeploymentgroup = "Deploy"
$DeploymentGroups = get-adgroup -filter "name -like '*$filterdeploymentgroup*'" -Properties samaccountname -searchbase "OU=Application Deployment,DC=D,DC=P" | Select-Object samaccountname | Sort -Property samAccountName
#Show Deployment Groups in List Box
$wpf.Deployment_Groups_ListBox.ItemsSource = $DeploymentGroups.samaccountname
$Deployment_Groups_ListBox_Items = $wpf.Deployment_Groups_ListBox.ItemsSource
#Output to Log
Log-Message "Deployment Groups Have Been Loaded"}