richtextbox and array data
Posted: Tue Mar 19, 2019 1:01 pm
I am doing a gwmi of a key. This key returns an array of data. Example: {1,16,5,7} if I run the following in PowerShell ISE it works.
But I can't get Append.Text to display the same array information in my RichTextBox.
I've tired $richtextbox.lines = $Results and that too displays nothing. How do I display the contents of an Array?
Code: Select all
$Reason = (gwmi -ComputerName 'RemoteSystem' -Class mbam_volume -Namespace root\microsoft\mbam).ReasonsForNoncompliance
$Reason
It will return
1
16
5
7
Code: Select all
$buttonWhyBitLockerFailed_Click = {
$textPC = $PCNameBox.Text
$statusbar1.text = 'Checking BitLocker, please wait...'
$richtextbox_output.Clear()
$Reason = (Get-WmiObject -ComputerName '$TextPC' -Class mbam_volume -Namespace root\microsoft\mbam).ReasonsForNoncompliance
if ($Reason -ne "")
{
$statusbar1.text = 'All done!'
$richtextbox_output.AppendText("MBAM Policy requires this volume to be encrypted but it is not. Errors are: $Reason")
}
}
I've tired $richtextbox.lines = $Results and that too displays nothing. How do I display the contents of an Array?