Solved

Data is not being append in datagridview.. Windows Forms

Posted on 2016-09-06
2
70 Views
Last Modified: 2016-09-08
I am using Powershell Studio to build a gui and the issue i have here is data is not getting appended... attached is the code.. Can someone help me in this ?
sample-query_renametops1.txt
0
Comment
Question by:Aamer Mohammed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 41789918
Replace $buttonShow_Click code block with following.. This basically stores all results in to $OS and then publish it in to the output window..
	$buttonShow_Click={
		$Servers = Get-Content $textbox1.Text
		$OS = $(foreach ($Server in $Servers)
		{
			Get-WmiObject -Class Win32_OperatingSystem -ComputerName $Server
		})
		$table = ConvertTo-DataTable -InputObject $OS -FilterWMIProperties
		Load-DataGridView -DataGridView $datagridview1 -Item $table
		$datagridview1.DataSource = $table
	}

Open in new window

0
 

Author Closing Comment

by:Aamer Mohammed
ID: 41790743
Thanks Subsum.. that works..
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question