Hello,
I have a script for enumerating the folder-date of Progress software on my computers.
The script runs fine but I want to sort the output on the lastwrite time. I’m a little stuck here.
Can anyone please help me in the right direction?
The output I get is:
Root LastWriteTime ---- ------------- \\WKS2000\c$ 1-12-2016 11:01:55 \\WKS2001\c$ 1-12-2016 11:05:36 \\WKS2002\c$ 1-12-2016 11:08:33 \\WKS2005\c$ 6-6-2016 15:49:44 \\WKS2007\c$ 6-6-2016 15:49:44 \\WKS2008\c$ 1-12-2016 12:38:55 \\WKS2009\c$ 31-10-2016 14:13:07 \\WKS2010\c$ 2-12-2016 14:12:21 \\WKS2011\c$ 31-10-2016 14:13:06 \\WKS2012\c$ 31-10-2016 14:16:19 \\WKS2013\c$ 31-10-2016 14:13:05 \\WKS2015\c$ 31-10-2016 14:16:26 \\WKS2016\c$ 31-10-2016 14:13:21 \\WKS2017\c$ 31-10-2016 13:27:46 \\WKS2019\c$ 6-6-2016 15:49:44 \\WKS2020\c$ 2-12-2016 11:19:36 \\WKS2021\c$ 2-12-2016 14:52:01 \\WKS2022\c$ 2-12-2016 09:20:00 WKS2023 Software installation not found \\WKS2024\c$ 31-10-2016 14:19:22 \\WKS2025\c$ 1-12-2016 12:59:26 \\WKS2027\c$ 31-10-2016 14:13:04 \\WKS2028\c$ 2-12-2016 14:04:00
The code I use is:
$allepcs2 = Get-ADComputer -Filter {(Name -like "wks*") -and (enabled -eq "true")} | Where { Test-Connection $_.name -count 1 -quiet } |Select-Object -expand Name foreach ($pc in $allepcs2) { if ( Test-Path "\\$pc\c$\Program Files (x86)\Progress Software Corporation\OpenEdge 11.5 Shared Network Installation\bin" ) { get-childitem "\\$pc\c$\Program Files (x86)\Progress Software Corporation\OpenEdge 11.5 Shared Network Installation\b*" |select root,lastwritetime } else { Write-host "$pc Software installation not found" } }