回答編集履歴

1

コマンド修正

2020/11/14 16:01

投稿

SHOMI
SHOMI

スコア4079

test CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  ```PowerShell
4
4
 
5
- $Dt=Get-Date -Format "yyyy/MM/dd";Get-ChildItem c:\temp | Where{$_.Name -Match "^aa[0-9]+$"} | Where{$_.LastWriteTime -lt $Dt.AddDays(-2)} | Remove-Item
5
+ [DateTime]$Dt=Get-Date -Format "yyyy/MM/dd";Get-ChildItem c:\temp | Where{$_.Name -Match "^aa[0-9]+$"} | Where{$_.LastWriteTime -lt $Dt.AddDays(-2)} | Remove-Item
6
6
 
7
7
  ```