小编ome*_*men的帖子

Powershell,尝试仅输出目录上的路径和lastwritetime

我正在尝试编写一个脚本,该脚本将输出90天内未更改的任何目录.我希望脚本显示整个路径名和lastwritetime.我写的脚本只显示路径名,但不显示lastwritetime.下面是脚本.

Get-ChildItem | Where {$_.mode -match "d"} | Get-Acl | 
    Format-Table @{Label="Path";Expression={Convert-Path $_.Path}},lastwritetime
Run Code Online (Sandbox Code Playgroud)

当我运行此脚本时,我得到以下输出:

Path                                                        lastwritetime
----                                                        ----------
C:\69a0b021087f270e1f5c
C:\7ae3c67c5753d5a4599b1a
C:\cf
C:\compaq
C:\CPQSYSTEM
C:\Documents and Settings
C:\downloads

我发现get-acl命令没有lastwritetime作为成员.那么如何才能获得路径和lastwritetime所需的输出?

powershell

2
推荐指数
1
解决办法
7334
查看次数

标签 统计

powershell ×1