Search found 17 matches

by Tnt48185
Fri May 10, 2019 8:52 am
Forum: PowerShell GUIs
Topic: Forms, text boxes and get-gpo
Replies: 32
Views: 3773

Re: Forms, text boxes and get-gpo

I forgot to change the get-gpo line to get-gpo -all. The results are the same, this just runs quicker for testing.
by Tnt48185
Fri May 10, 2019 8:43 am
Forum: PowerShell GUIs
Topic: Forms, text boxes and get-gpo
Replies: 32
Views: 3773

Re: Forms, text boxes and get-gpo

Maybe you just need the whole script to get past the fact that I’m simply asking about populating a text box. There is absolutely no need for a function. That is a preference. See below. [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [void][System.Reflection.Assembly...
by Tnt48185
Fri May 10, 2019 8:21 am
Forum: PowerShell GUIs
Topic: Forms, text boxes and get-gpo
Replies: 32
Views: 3773

Re: Forms, text boxes and get-gpo

I looked at your code. There are many undefined variables and some syntax that will never do anything. Write the button click code at a PS prompt and debug it until it gives you what you want. You will have to make it a function that does not depend on the form. One item that is obvious. The follow...
by Tnt48185
Fri May 10, 2019 8:19 am
Forum: PowerShell GUIs
Topic: Forms, text boxes and get-gpo
Replies: 32
Views: 3773

Re: Forms, text boxes and get-gpo

The following line will never return anything. It is just bad code. $xmlpaths = Get-ChildItem -Path "\\$($GPODom)\SYSVOL\$($GPODom)\Policies\{$($GPOID)}\*" -Include @($Look_XML) -Recurse -Force | % { $_.fullname } Its purpose makes no sense and any result will never be available. You are incorrect....
by Tnt48185
Fri May 10, 2019 8:15 am
Forum: PowerShell GUIs
Topic: Forms, text boxes and get-gpo
Replies: 32
Views: 3773

Re: Forms, text boxes and get-gpo

Thanks for your help! You might have missed where I said I shortened the script to only what was needed to reproduce the error. In my script, get-gpo -id is switched to get-gpo -all which creates the array. Further, $look_xml is an array of file names and populates $xmlpaths just fine. This is actua...
by Tnt48185
Fri May 10, 2019 7:25 am
Forum: PowerShell GUIs
Topic: Forms, text boxes and get-gpo
Replies: 32
Views: 3773

Re: Forms, text boxes and get-gpo

Hi Jvierra and thank you for your response. I rewrote the script as compact as possible where the issue still occurs. Would you mind having a look? You would have to replace the gpo ID but otherwise you should see where the textbox does not update but write-host shows progress. [void][System.Reflect...
by Tnt48185
Thu May 09, 2019 11:45 pm
Forum: PowerShell GUIs
Topic: Forms, text boxes and get-gpo
Replies: 32
Views: 3773

Forms, text boxes and get-gpo

Anyone have any idea? I create a form, add a text box, change the text, run test$=get-gpo -all, and I can no longer change the value of said text box unless I use a pause command afterwards. Ex. $TxtBox2.Text = "Gathering GPO's" $GPO = Get-GPO -Id "{71da5601-498e-4e3e-86cf-0f35d63bf322}" $TxtBox2.T...