Search found 11262 matches

by jvierra
Thu Sep 21, 2017 9:35 am
Forum: PowerShell GUIs
Topic: Run job as a function?
Replies: 12
Views: 136

Re: Run job as a function?

I think bottomline is indeed I have to make the script wait for the end of the job. Though I don't know how to make it do that. The whole purpose of the JobTrakker is to no wait. THe "JobCompleted" script block is called when the job is complete. This is where the data is available if it has not be...
by jvierra
Thu Sep 21, 2017 9:32 am
Forum: PowerShell GUIs
Topic: Run job as a function?
Replies: 12
Views: 136

Re: Run job as a function?

Without the code you are using it is impossible to understand the question or propose an answer. You have to think this through and post a code example that is actually being used and an explatnation that we can understand.
by jvierra
Thu Sep 21, 2017 6:16 am
Forum: PowerShell GUIs
Topic: Run job as a function?
Replies: 12
Views: 136

Re: Run job as a function?

stevens wrote:
Thu Sep 21, 2017 12:37 am
... I copy pasted the commented code. I guessed you would have figured that.
What good is code that is commented out going to do. All of the code pasted is commented out so it will never run.
by jvierra
Thu Sep 21, 2017 5:56 am
Forum: PowerShell GUIs
Topic: Hide and disable single TreeView node
Replies: 6
Views: 158

Re: Hide and disable single TreeView node

Thanks jvierra, so you have a small example on how can I add the code to the form class Sorry but I do not have an example currently. Maybe I will create a simple example next weekend. You can start by build your customized control in Visual Studio. This will likely take you some time if you have n...
by jvierra
Wed Sep 20, 2017 4:28 pm
Forum: PowerShell GUIs
Topic: Help with the responsive form
Replies: 7
Views: 68

Re: Help with the responsive form

You will need to be sure the Update script runs for all jobs and that the progress steps are set correctly as well as the initial value. This will require using arithmetic and some serious design thinking to adapt the tracker to your requirements.
by jvierra
Wed Sep 20, 2017 4:13 pm
Forum: PowerShell GUIs
Topic: Help with the responsive form
Replies: 7
Views: 68

Re: Help with the responsive form

Just run Add-JobTracker multiple times. That is why it is called "Add"-JobTracker. The verb in PS always telss us what a CmdLet is trying to do.
by jvierra
Wed Sep 20, 2017 3:48 pm
Forum: PowerShell GUIs
Topic: Help with the responsive form
Replies: 7
Views: 68

Re: Help with the responsive form

Just add 20 jobs to the JobTracker. They will all run in parallel.
by jvierra
Wed Sep 20, 2017 3:29 pm
Forum: PowerShell GUIs
Topic: Capture Output to Rich Text Box
Replies: 2
Views: 39

Re: Capture Output to Rich Text Box

You cannot easily capture the verbose output. Do this: $output = Invoke-Command -ComputerName $Realservername -ScriptBlock { Remove-Item -path $args[0] -Recurse -force -PassThru } -ArgumentList $profPathComplete Or this. $output = Invoke-Command -ComputerName $Realservername -ScriptBlock { Remove-It...
by jvierra
Wed Sep 20, 2017 3:24 pm
Forum: Windows PowerShell
Topic: $richTextBox
Replies: 11
Views: 116

Re: $richTextBox

You still need to place only one breakpoint on that line. If you don't hit the breakpoint then the code is never being executed and the "X" variable is never getting created. Remember that variables are automatic and exisit on ly if they have been assigned. Programming is more than half about learni...
by jvierra
Wed Sep 20, 2017 1:18 pm
Forum: PowerShell GUIs
Topic: Run job as a function?
Replies: 12
Views: 136

Re: Run job as a function?

You have successfully commented out all of your code after "<#region job" A "region" declaration looks like this. #region <comment tag goes here> ... code #endregion <same comment tag here for convenience> This "<#" opens a block comment which comments out all lines until it sees "#>". "#" is the sa...