Renommer un fichier selon un Format
bonsoir a tous
j'aurai besoin de renommer quelque Fichier après avoir faire quelque traitement spécifique
les fichier sont avec cette format "production1.txt" "production2.txt","production3.txt" j'aurai besoin de renomer chaque fichier pour avoir cette format "Archive_production1_20180329" "Archive_production1_20180329"
pour cela j'ai essayer de commencer a travers ces lignes ais j'ai arrivé a compléter
Code:
1 2 3 4 5 6
| $date=get-date -Format yyyymmdd
$files=Get-ChildItem -path C:\folder -Filter *.txt
foreach($file in $files)
{$newfile=$file.Name.replace ("production","Archive_Production")
rename-item $file $newfile
} |
Qui peut m'aider a trouver une solution
Merci pour vos aides