# Powershell Studio help?

**URL:** <https://forums.powershell.org/t/powershell-studio-help/9209>\
**Category:** PowerShell Help\
**Created:** [August 21, 2017, 9:36am UTC](https://forums.powershell.org/t/powershell-studio-help/9209 "2017-08-21T09:36:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![powershell-noob](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@powershell-noob](https://forums.powershell.org/u/powershell-noob)\
**Post date:** [August 21, 2017, 9:36am UTC](https://forums.powershell.org/t/powershell-studio-help/9209/1 "2017-08-21T09:36:02Z")

</div>

Right now I am learning Powershell Studio, so I have a basic code that has a Button plus a RichTextBox.

[Code](http://textuploader.com/d6kph)

I am having trouble figuring out where I would need to insert my RichTextBox code so I can have the output display there.

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![pdearmen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/pdearmen/32/263_2.png) [@pdearmen](https://forums.powershell.org/u/pdearmen)\
**Post date:** [August 21, 2017, 12:28pm UTC](https://forums.powershell.org/t/powershell-studio-help/9209/2 "2017-08-21T12:28:00Z")

</div>

If you want the information to display in the rich text box as soon as you click on the button then the code to display the information in the text box should appear in the event for the button click for the button SystemInfo - $buttonSystemInfo\_Click

---

<div class="post-metadata">

**Author:** ![powershell-noob](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@powershell-noob](https://forums.powershell.org/u/powershell-noob)\
**Post date:** [August 21, 2017, 1:05pm UTC](https://forums.powershell.org/t/powershell-studio-help/9209/3 "2017-08-21T13:05:04Z")

</div>

I did have $RichTextBox.Text = $Object. Runs but nothing is displayed.

---

<div class="post-metadata">

**Author:** ![pdearmen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/pdearmen/32/263_2.png) [@pdearmen](https://forums.powershell.org/u/pdearmen)\
**Post date:** [August 21, 2017, 2:04pm UTC](https://forums.powershell.org/t/powershell-studio-help/9209/4 "2017-08-21T14:04:26Z")

</div>

I tried the following chunk and it worked fine and showed up in my copy of studio

```
$buttonSystemInfo_Click = {
	#TODO: Place custom script here
	Import-Module Activedirectory
	$pc = Read-Host -Prompt " Enter Computer Name"
	$bios = Get-WmiObject Win32_BIOS -ComputerName $pc
	$networkResult = Get-WmiObject win32_networkadapterconfiguration -Filter 'ipenabled = "true"' -ComputerName $pc
	
	$Object = New-Object PSObject -Property @{
		'BIOS Version' = $bios.Version
		'Serial Number' = $bios.SerialNumber
		'MACAddress' = $networkResult.MACAddress
	}
	$richtextbox1.text = $Object | Out-String
}
```

The formatting isn’t the nicest doing just out-string like that so i cleaned it up a little

```
$richtextbox1.Text = $object.psobject.properties | Where-Object{ $_.membertype -eq "noteproperty" } | ForEach-Object{
		"$($_.name) - $($_.value)`r`n"
	}
```

---

<div class="post-metadata">

**Author:** ![powershell-noob](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@powershell-noob](https://forums.powershell.org/u/powershell-noob)\
**Post date:** [August 21, 2017, 2:15pm UTC](https://forums.powershell.org/t/powershell-studio-help/9209/5 "2017-08-21T14:15:38Z")

</div>

Hey I appreciate the help. I was putting the code in the wrong line. It works, now I have to work on formatting it. Would format-table be better?

---

<div class="post-metadata">

**Author:** ![pdearmen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/pdearmen/32/263_2.png) [@pdearmen](https://forums.powershell.org/u/pdearmen)\
**Post date:** [August 21, 2017, 3:41pm UTC](https://forums.powershell.org/t/powershell-studio-help/9209/6 "2017-08-21T15:41:01Z")

</div>

Not on my computer with studio but I imagine it would not be better off the top of my head. You can always test it out to see if its better as well

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:37pm UTC](https://forums.powershell.org/t/powershell-studio-help/9209/7 "2024-05-16T20:37:42Z")

</div>


