Search found 318 matches

by sekou2331
Tue Dec 01, 2020 11:16 am
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

Ok thanks. Last question If I run in parallel a trigger to run a schedule task on a remote computer that calls a MSI to install will this have the same issue of dying before completed? Workflow version workflow Invoke-Installer { param ( [string[]]$servers ) foreach -parallel ($server in $servers) {...
by sekou2331
Sun Nov 29, 2020 7:45 am
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

I know start-sleep. I mean how would I use that in the in the parallel code?
by sekou2331
Wed Nov 25, 2020 6:18 am
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

Ok then when you say sleep in the session can you give me a example?
by sekou2331
Mon Nov 23, 2020 3:54 pm
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

So looks like this works. With the -Wait. Looks like it leaves it in a wait state and comes out. 'server1', 'server2' | ForEach-Object -Parallel { $Software = 'SoftwareName.msi' Invoke-Command -ComputerName $_ -ScriptBlock { $softwareFormat = "$using:Software" $arguments = '/qn /log D:\the...
by sekou2331
Mon Nov 23, 2020 3:28 pm
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

Is ideal to use the below Would this be ideal or should I not go that route? 'server1', 'server2' | ForEach-Object -Parallel { $Software = 'SoftwareName.msi' Invoke-Command -ComputerName $_ -ScriptBlock { $softwareFormat = "$using:Software" $arguments = '/qn /log D:\theLog.log PRODUCT_INST...
by sekou2331
Mon Nov 23, 2020 1:27 pm
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

ok where am I using quotes wrong and the install takes some time. How can I run the installer in parallel without it dying before completed?
by sekou2331
Mon Nov 23, 2020 9:29 am
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

So I was trying the below. I get no error but it seems not to work. 'server1', 'server2' | ForEach-Object -Parallel { $Software = 'SoftwareName.msi' Invoke-Command -ComputerName $_ -ScriptBlock { $softwareFormat = "$using:Software" $arguments = '/qn /log D:\theLog.log PRODUCT_INSTALLDIR=&q...
by sekou2331
Tue Nov 17, 2020 6:10 pm
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

But the function would have to be in the the workflow and can not be called from outside the workflow?
by sekou2331
Mon Nov 16, 2020 5:00 pm
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

So it looks like this is for PowerShell 7. I am on PowerShell 5. Can this be done with workflows? If so is it possible to use work flow with function?
by sekou2331
Sat Nov 07, 2020 4:49 pm
Forum: PowerShell
Topic: Calling function in a Parallel foreach loop
Replies: 23
Views: 13811

Re: Calling function in a Parallel foreach loop

Ok please dont close post I am going to write the script and see if is works.