Search found 10 matches

by Rabid138
Thu Oct 10, 2019 9:14 am
Forum: PowerShell GUIs
Topic: Pass a variable
Replies: 10
Views: 2651

Re: Pass a variable

Thanks.
by Rabid138
Thu Oct 10, 2019 9:01 am
Forum: PowerShell GUIs
Topic: Pass a variable
Replies: 10
Views: 2651

Re: Pass a variable

Thanks again for pointing me to the right direction! I got this to work with the window hidden. After I exported to PS1 from PSS, I add the following at line 1: $location = $args[0] $Input = ($location -split ',*..=')[1] Then I changed any reference to $Input inside the function to $Script:Input. Th...
by Rabid138
Thu Oct 10, 2019 8:29 am
Forum: PowerShell GUIs
Topic: Pass a variable
Replies: 10
Views: 2651

Re: Pass a variable

First, I want to say thank you for replying to all of my newbie questions. I really appreciate it, since forms are really new to me. Not to sound dense but what do people normally do for a context menu and ADUC? I had a form working with the hidden switch. Below is the first part of the script. I am...
by Rabid138
Thu Oct 10, 2019 7:06 am
Forum: PowerShell GUIs
Topic: Pass a variable
Replies: 10
Views: 2651

Re: Pass a variable

I really appreciate your help! I am almost there. Granted I might be going about this all wrong. So using your form as an example, everything works if I do the following: PowerShell.exe -ExecutionPolicy Bypass -File "\\MYDOMAIN.com\SYSVOL\MYDOMAIN.com\scripts\ContextMenus\TestSPN.ps1" &quo...
by Rabid138
Wed Oct 09, 2019 5:08 pm
Forum: PowerShell GUIs
Topic: Pass a variable
Replies: 10
Views: 2651

Re: Pass a variable

I was under the impression that one had to hack the registry to make a context menu for ADUC to run a .ps1 file. My goal is to be able to right-click a computer in ADUC and for the form to know what computer I just right-clicked.
by Rabid138
Wed Oct 09, 2019 4:44 pm
Forum: PowerShell GUIs
Topic: Pass a variable
Replies: 10
Views: 2651

Pass a variable

I have a custom Active Directory context menu. The menu item calls a .bat file (because as far as I know you cannot call a .ps1 file). .bat PowerShell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "\\mydomain.com\SYSVOL\mydomain.com\scripts\ContextMenus\Computeredit.ps1" "%*&q...
by Rabid138
Wed Oct 09, 2019 3:28 pm
Forum: PowerShell GUIs
Topic: Multi-line textbox output
Replies: 7
Views: 3235

Re: Multi-line textbox output

Thank you very much. This got me on the right track!
by Rabid138
Wed Oct 09, 2019 10:50 am
Forum: PowerShell GUIs
Topic: Multi-line textbox output
Replies: 7
Views: 3235

Re: Multi-line textbox output

This gives the desired result. Thanks!

Code: Select all

$SPN = Get-ADComputer MYCOMPUTER -Properties servicePrincipalName | select -ExpandProperty servicePrincipalName

foreach ($item in $SPN)
{
$item = $item -split ' '
$textbox1.AppendText("$($item)`n")
}
by Rabid138
Wed Oct 09, 2019 10:28 am
Forum: PowerShell GUIs
Topic: Multi-line textbox output
Replies: 7
Views: 3235

Re: Multi-line textbox output

While that does output servicePrincipalName to the textbox, it outputs as one long line. What I would like is to have it output each servicePrincipalName entry in AD to a newline in the textbox. Current output in the textbox: CmRcService/MYCOMPUTER CmRcService/MYCOMPUTER.mydomain.com Desired output:...
by Rabid138
Wed Oct 09, 2019 10:13 am
Forum: PowerShell GUIs
Topic: Multi-line textbox output
Replies: 7
Views: 3235

Multi-line textbox output

Brand new to Powershell Studio and so far loving it. I want to do something seemingly so simple but can't quite figure out how. For testing, I have a single form with one multi-line textbox. $form1_Load={ #TODO: Initialize Form Controls here $SPN = Get-ADComputer MYCOMPUTER -Properties servicePrinci...