Page 2 of 4

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 8:52 am
by Tnt48185
I forgot to change the get-gpo line to get-gpo -all. The results are the same, this just runs quicker for testing.

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 8:55 am
by jvierra
Please read the red box at the top of this topic. It asks to post large amounts of code as an attached PS1 file. Copying large amounts of code is almost impossible to do without errors.

Please edit your post with the full code and add it as an attachment

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 9:04 am
by Tnt48185
Dang it, and $searchterm = $txtbox.text
Not $txtbox1.text

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 9:11 am
by Tnt48185
Ok, reposting as attachment with corrections... just noting however, my red box states to either use select code or attach...
script.txt
(7.57 KiB) Downloaded 88 times

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 9:11 am
by jvierra
Here is an example of how to enumerate this and create a form that gives you decent feedback. I changed the code to use "All". It is fast and easier to understand.

See attached.

Also take some time to learn how to write PowerShell code. You are copying and guessing which makes things much more difficult for you,

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 9:13 am
by jvierra
Tnt48185 wrote: Fri May 10, 2019 9:11 am Ok, reposting as attachment with corrections... just noting however, my red box states to either use select code or attach...script.txt
Post code as a function PS1 file and not just some text. Remember that technical help requires some assistance from the one asking for help to make the job easier for us. We cannot guess at what is in you mind.

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 9:20 am
by Tnt48185
I can not attach a .ps1 file as I am blocked from doing so. You can’t change a file extension after downloading??? Thanks for the help but really? It is getting a little ridiculous. It is as though you keep having me re-post until I give up and you never really answer the question...

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 9:24 am
by jvierra
Tnt48185 wrote: Fri May 10, 2019 9:20 am I can not attach a .ps1 file as I am blocked from doing so. You can’t change a file extension after downloading??? Thanks for the help but really? It is getting a little ridiculous. It is as though you keep having me re-post until I give up and you never really answer the question...
Delete the TXT file and upload a new PS1 file. You can't rename a file once uploaded.

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 9:43 am
by Tnt48185
I cannot upload a ps1 on my network. It is not allowed by policy. All you have to do is change the dang extension or copy and paste or download, save as....

Re: Forms, text boxes and get-gpo

Posted: Fri May 10, 2019 9:45 am
by jvierra
Tnt48185 wrote: Fri May 10, 2019 9:43 am I cannot upload a ps1 on my network. It is not allowed by policy. All you have to do is change the dang extension or copy and paste or download, save as....
Oh. You network won't allow you to "upload" a PS1.

The code I posted should demonstrate everything you need to understand how the code should work.