JobProgressBar
Posted: Thu Oct 15, 2015 12:13 pm
Hi Everyone,
I saw David Corrales's post on "Creating Responsive Loops".
https://www.sapien.com/blog/2011/07/15/ ... ive-loops/
It's a great article. Very informative. I'm planning to use to call functions to copy things, however I'm kind of stuck. I can't figure out how to use FOREACH loop, pass the function, wait for the first job to complete then update the progress bar.
Here is my function. I have 5 of these. Anyone help would be appreciated.
1. Product, version and build - PowerShell Studio 2015, 4.2.93
2. 32 or 64 bit product - 64-bit
3. Operating system, e.g.- Windows 7 64-bit
4. Attach a screenshot, if applicable - N/A
5. Attach logs, crash reports, etc., in a ZIP file - N/A
I saw David Corrales's post on "Creating Responsive Loops".
https://www.sapien.com/blog/2011/07/15/ ... ive-loops/
It's a great article. Very informative. I'm planning to use to call functions to copy things, however I'm kind of stuck. I can't figure out how to use FOREACH loop, pass the function, wait for the first job to complete then update the progress bar.
Here is my function. I have 5 of these. Anyone help would be appreciated.
Code: Select all
Function Copy-1
{
Try
{
$Source = "C:\TestFrom\1"
$Destination = "C:\CopyTo"
IF (-not (Test-Path $Destination))
{
New-Item -Type Directory $Destination -Force
}
Copy-Item $Source -Recurse -Destination $Destination -Container -Force
}
Catch
{
"$Error[0].ToString()" | Out-File "C:\backup\job.log"
}
$Source = $null
$Destination = $null
}
1. Product, version and build - PowerShell Studio 2015, 4.2.93
2. 32 or 64 bit product - 64-bit
3. Operating system, e.g.- Windows 7 64-bit
4. Attach a screenshot, if applicable - N/A
5. Attach logs, crash reports, etc., in a ZIP file - N/A