検証用ファイルやサンプルデータを作っていると、作成日時・更新日時・アクセス日時をまとめて揃えたい場面があります。

PowerShellなら CreationTime / LastWriteTime / LastAccessTime を使って、カレントディレクトリ配下のファイルを一括変更できます。

-Recurse でサブフォルダー込み、-Filter で特定拡張子だけ、-File を外せばフォルダー自体も対象にできます。
元の日時は基本戻せないので、実行前のバックアップは大事です。

https://chun-log.jp/powershell-file-timestamp-change/?utm_source=mastodon&utm_medium=social&utm_campaign=post

#PowerShell #Windows #コマンド #GetChildItem #ForEachObject #FileSystemInfo #タイムスタンプ #WindowsTips

PowerShellでファイルのタイムスタンプを一括変更する方法

PowerShellでファイルの作成日時・更新日時・アクセス日時をまとめて変更する方法を、サブフォルダーや拡張子指定の例付きで解説します。

ちゅんろぐ
One Open-source Project Daily

Get-ChildItemColor provides colorized version of Get-ChildItem Cmdlet of PowerShell.

https://github.com/joonro/Get-ChildItemColor

#1ospd #opensource #color #getchilditem #ls #powershell
GitHub - joonro/Get-ChildItemColor: Get-ChildItemColor provides colorized version of Get-ChildItem Cmdlet of PowerShell.

Get-ChildItemColor provides colorized version of Get-ChildItem Cmdlet of PowerShell. - joonro/Get-ChildItemColor

GitHub