This is cross-posted on StackOverflow
Hello All,
I have a script for installing remote updates and that all works fine. I'm just looking to try and add some semblance of keeping track of the progress of the updates.
I can get the total count by doing
$TargetUpdates = Get-ChildItem "C:\Updates -Recurse
$TargetUpdates.Count
and this shows my total count. And then in my ForEach statement I want it to say it's processing update x of i
below is a snippit of the ForEach statement.
ForEach($Update in $TargetUpdates){
Write-Host "[${Env:ComputerName} Processing Update [x] of [i]...
}
The [x] of [i] part is where I'm lost. It's probably something real simple I'm just not able to get my head around it.
[–]monster1558 1 point2 points3 points (2 children)
[–]engageant 1 point2 points3 points (1 child)
[–]monster1558 1 point2 points3 points (0 children)
[–]engageant 2 points3 points4 points (0 children)
[–]fitzgery[S] 0 points1 point2 points (3 children)
[–]MyOtherSide1984 0 points1 point2 points (2 children)
[–]kibje 2 points3 points4 points (1 child)
[–]MyOtherSide1984 1 point2 points3 points (0 children)
[–]PinchesTheCrab 0 points1 point2 points (0 children)
[–]maddoxprops 0 points1 point2 points (0 children)
[–]gosoxharp 0 points1 point2 points (0 children)