1 2 3 4 5 6 7 8 9 10 | "hola" | out-file 2020-11-26.txt "hola" | out-file 2020-11-25.txt foreach($nombre in Get-ChildItem) { if($nombre.Name.Split("-")[2].replace(".txt","") % 2 -eq 1) { Remove-Item $nombre -WhatIf } } |
1 2 3 4 5 6 7 8 9 10 | "hola" | out-file 2020-11-26.txt "hola" | out-file 2020-11-25.txt foreach($nombre in Get-ChildItem) { if($nombre.Name.Split("-")[2].replace(".txt","") % 2 -eq 1) { Remove-Item $nombre -WhatIf } } |