RayT
asked on
Arrays & Loops in PowerShell
How do I modify the following script to use Arrays and Loops?
I would like the search folders to be in an array. Then I can just loop through the array.
$compareDate = (Get-Date).AddDays(-14)
$temp = Get-ChildItem "c:\vbapps\ASP.NET_Apps\" -Recurse| Where-Object { $_.LastWriteTime -ge $compareDate } | Select FullName
$result = $temp
$temp = Get-ChildItem "c:\vbapps\WinForms_Apps\" -Recurse| Where-Object { $_.LastWriteTime -ge $compareDate } | Select FullName
$result = $temp + $result
$result
I would like the search folders to be in an array. Then I can just loop through the array.
$compareDate = (Get-Date).AddDays(-14)
$temp = Get-ChildItem "c:\vbapps\ASP.NET_Apps\" -Recurse| Where-Object { $_.LastWriteTime -ge $compareDate } | Select FullName
$result = $temp
$temp = Get-ChildItem "c:\vbapps\WinForms_Apps\"
$result = $temp + $result
$result
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER