- Date: 2021-01-04
- Time: 14:18:17
Expand the following summaries for more details:
Environment:
if ($PSVersionTable.PSEdition -ne "Core") { | |
if ($myInvocation.Line) { | |
&"$env:ProgramFiles\PowerShell\7\pwsh.exe" -NonInteractive -executionPolicy Bypass -NoProfile $myInvocation.Line | |
} | |
else { | |
&"$env:ProgramFiles\PowerShell\7\pwsh.exe" -NonInteractive -executionPolicy Bypass -NoProfile -file "$($myInvocation.InvocationName)" $args | |
} | |
exit $lastexitcode | |
} |
$objects = (0..273) | |
$batchValue = 20 | |
$result = New-Object System.Collections.ArrayList | |
$id = 1 | |
for ($i = 0; $i -lt $objects.Count; $i += $batchValue) { | |
$start = $i + 1 | |
$end = ($i + 19) -gt $objects.Count ? $objects.count : $i + 19 | |
$progressParams = @{ | |
Activity = "Testing.." | |
Status = "Processing batch $start - $end of $($objects.count)" |
function Watch-BitsTransfer { | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory = $true)] | |
[guid]$JobId | |
) | |
$perc = 0 | |
while ($perc -le 100 ) { | |
$jobState = Get-BitsTransfer -JobId $JobId | Select-Object BytesTransferred, BytesTotal | |
$percentCompleteState = ($jobState.BytesTransferred / $jobState.BytesTotal * 100) |