Create a data GridView, select single/multiple rows and execute something

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
ramses147
Posts: 110
Last visit: Tue Dec 05, 2023 7:11 am
Been upvoted: 1 time

Create a data GridView, select single/multiple rows and execute something

Post by ramses147 »

Hi guys,

i'd like to:

1- create a simple gridview from a csv file like this in attachment
2- then i would like to select one or multiple rows
3- save each value row in a variable, for example $computername=A2 $localaccount=B2 DomainAccount=C2
4- use a button to do something, for example write-host $computername $localaccount DomainAccount

is it possible ?
Attachments
Cartel1 - Excel000690.jpg
Cartel1 - Excel000690.jpg (31.25 KiB) Viewed 1542 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create a data GridView, select single/multiple rows and execute something

Post by jvierra »

Import-Csv myfile.csv | Out-GridView

help Out-GridView -Full
User avatar
ramses147
Posts: 110
Last visit: Tue Dec 05, 2023 7:11 am
Been upvoted: 1 time

Re: Create a data GridView, select single/multiple rows and execute something

Post by ramses147 »

Thanks Jvierra !
This topic is 6 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked