Question Renommer une série de fichier

Plus d'informations
il y a 12 ans 3 mois #16580 par Laurent Dardenne
Essaie ceci :
[code:1]
$SearchBeginStr='Conversation with '
$SearchStr=$SearchBeginStr+'(?<Personne>.*)'
$FormatDate='{2:dd-MM-yyyy}'
$FormatName=\"{0}\{1}_$FormatDate.html\"
$Date=Get-Date

$sbChangeExt={
$SearchName=($SearchBeginStr -replace ' ','_')+ $_.Matches[0].Groups[\"Personne\"].Value
$FormatName -F ([System.IO.Path]::GetDirectoryName($_.Path)),$SearchName,$Date
}

$Files=Select-String -Path 'C:\Temp\*.HIST' -Pattern $SearchStr
$Files|Foreach {$Count++;$_}|Rename-item -NewName $sbChangeExt -Whatif -Verbose
[/code:1]

Tutoriels PowerShell

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 12 ans 3 mois #16581 par wackou
Réponse de wackou sur le sujet Re:Renommer une série de fichier
Ça ne fonctionne pas =/

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.040 secondes
Propulsé par Kunena