$theFolder = "\\server.domain.com\share\folder"
$theFiles = (Get-ChildItem -Path $myFolder -Filter Prefix*.type ).Name
foreach ($File in $myFiles)
{
$FullPathFileName = $theFolder + "\" + $File
$newName = ($File).Replace(" ","_")
Rename-Item -Path $FullPathFileName -NewName $newName -Force
}
No comments:
Post a Comment