回答編集履歴

1

例に示すそれぞれのディレクトリに対する処理になっていなかったのを修正

2018/08/16 09:36

投稿

reosablo
reosablo

スコア339

test CHANGED
@@ -4,6 +4,6 @@
4
4
 
5
5
  ```powershell
6
6
 
7
- Get-ChildItem *.log | % { Rename-Item $_ "$_-$(Get-Date -Format "yyyyMMdd")" }
7
+ Get-ChildItem C:\tmp\log1*.log, C:\tmp\log2*.log | ForEach-Object { Rename-Item $_.FullName "$_-$(Get-Date -Format "yyyyMMdd")" }
8
8
 
9
9
  ```