Search found 11260 matches

by jvierra
Thu Sep 21, 2017 6:16 am
Forum: PowerShell GUIs
Topic: Run job as a function?
Replies: 10
Views: 77

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: 7
Views: 151

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: 64

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: 64

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: 64

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: 31

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: 96

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: 10
Views: 77

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...
by jvierra
Wed Sep 20, 2017 1:11 pm
Forum: Windows PowerShell
Topic: $richTextBox
Replies: 11
Views: 96

Re: $richTextBox

Because $x is null. Now you get to debug your command. break should stop on "$x = <command>" but only if $global:vm is a collection with at least one member. Break and inspect $global:vm.
by jvierra
Wed Sep 20, 2017 12:50 pm
Forum: PowerShell GUIs
Topic: Help with the responsive form
Replies: 7
Views: 64

Re: Help with the responsive form

Why would you add 20 scripts to the same job? That makes no sense. Are you saying you want to create 20 separate jobs? Just add the jobs one at a time. JobTracker will manage multiple jobs.
If you have 20 steps and you want them to run parallel as one job then use a workflow and add that as a job.