Search found 13003 matches

by jvierra
Fri Jan 04, 2019 6:14 am
Forum: PowerShell GUIs
Topic: Multi-Form - credential passing
Replies: 7
Views: 247

Re: Multi-Form - credential passing

lontru wrote:
Fri Jan 04, 2019 3:57 am

have work a little with your demo...is there a way open more then one sub psf form
Comment the line:

$job | Wait-Job | Remove-Job

You can now open multiple forms. Run a timer to remove jobs that complete when the child form is closed.
by jvierra
Thu Jan 03, 2019 12:58 pm
Forum: PowerShell GUIs
Topic: Multi-Form - credential passing
Replies: 7
Views: 247

Re: Multi-Form - credential passing

Here is perhaps a better way to do this. See the attached project.

THis is the only way to pass objects to a new process. With Start-Process you can only pass strings.
by jvierra
Wed Jan 02, 2019 2:46 pm
Forum: Windows PowerShell
Topic: Splitting an XML file into smaller XML files
Replies: 1
Views: 210

Re: Splitting an XML file into smaller XML files

Start with loading the file as XML.

[xml]$xml = Get-Content printers.xml

Now you can just group the printers and copy to a new XML file.

$group1 = $xml.Printers.Printer[0..149]

Add the Group to a new file after creating it and importing the nodes to copy.
by jvierra
Wed Jan 02, 2019 9:44 am
Forum: Windows PowerShell
Topic: ThreadOptions ReuseThread not working
Replies: 7
Views: 496

Re: ThreadOptions ReuseThread not working

With the Sapien implementation this is the "$host" in use: Name : PrimalScriptHostImplementation Version : 3.0.0.0 InstanceId : 12d52fb0-3fc8-431c-8c72-7aba3be25b4f UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : en-US CurrentUICulture : en-US PrivateData :...
by jvierra
Wed Jan 02, 2019 9:10 am
Forum: Windows PowerShell
Topic: ThreadOptions ReuseThread not working
Replies: 7
Views: 496

Re: ThreadOptions ReuseThread not working

Also note the following about ThreadOptions. PS D:\scripts> $host.Runspace.ThreadOptions = 1 Exception setting "ThreadOptions": "The thread options can only be changed if the apartment state is multithreaded apartment (MTA), the current options are UseNewThread or UseCurrentThread, and the new value...
by jvierra
Wed Jan 02, 2019 9:01 am
Forum: Windows PowerShell
Topic: ThreadOptions ReuseThread not working
Replies: 7
Views: 496

Re: ThreadOptions ReuseThread not working

"ReuseThread" can only be set before the runspace is created. Once it is created and a thread is allocated the property is read-only.
by jvierra
Wed Jan 02, 2019 4:22 am
Forum: PowerShell GUIs
Topic: Multi-Form - credential passing
Replies: 7
Views: 247

Re: Multi-Form - credential passing

You cannot do this. You can only start a completely new process with new credentials.
by jvierra
Fri Dec 28, 2018 6:19 am
Forum: PowerShell GUIs
Topic: Use textbox to open form make sound
Replies: 7
Views: 235

Re: Use textbox to open form make sound

Whenever you repurpose the return key then any change of focus will cause a bell sound. This is an unfortunate side effect of a dialog. I suggest using a button to open the subform and not using the enter key.
by jvierra
Fri Dec 28, 2018 6:01 am
Forum: PowerShell GUIs
Topic: Use textbox to open form make sound
Replies: 7
Views: 235

Re: Use textbox to open form make sound

Sorry. I now see the folder in the zip.
by jvierra
Fri Dec 28, 2018 6:00 am
Forum: PowerShell GUIs
Topic: Use textbox to open form make sound
Replies: 7
Views: 235

Re: Use textbox to open form make sound

I need a PSF and not a picture.