I am trying to write a script that will output any directory that has not changed in over 90 days. I want the script to ONLY show the entire path name and lastwritetime. The script that I wrote only shows the path name but not the lastwritetime. Below is the script.
Get-ChildItem | Where {$_.mode -match "d"} | Get-Acl |
Format-Table @{Label="Path";Expression={Convert-Path $_.Path}},lastwritetime
When I run this script, I get the following output:
Path lastwritetime ---- ---------- C:\69a0b021087f270e1f5c C:\7ae3c67c5753d5a4599b1a C:\cf C:\compaq C:\CPQSYSTEM C:\Documents and Settings C:\downloads
I discovered that the get-acl command does not have lastwritetime as a member. So how can I get the needed output for only the path and lastwritetime?