1 Replies - 689 Views - Last Post: 04 August 2011 - 07:31 AM

#1 thomas130  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 04-March 11

Having a problem with my loop in powershell

Posted 04 August 2011 - 04:29 AM

Hi guys I'm having problem with my powershell script basically I getting powershell to compare how many files are within two different folders and once they match the loop ends.

The problem is with the second part of the loop even though more files have been dropped in, the calculation to check the progress doesn’t seem to update. It's like it not running the calculation again and just using the same answer as before and the loop never ends even through the same amount of files are there

Is there something I'm missing?

Thanks
Tom




$num = 10749

$list = Get-childitem "c:\knowledge planning" -Recurse
$listcount = $list.count
$cal = (100 /$num) * $listcount

while ($listcount -lt $num) {Write-Host "Progress Completed $cal"}




Is This A Good Question/Topic? 0
  • +

Replies To: Having a problem with my loop in powershell

#2 thomas130  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 04-March 11

Re: Having a problem with my loop in powershell

Posted 04 August 2011 - 07:31 AM

sorted it now thanks

I think I put this in the wrong topic anyway
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1