I kept get error for the below script:
#rename file
ForEach ($i in Get-ChildItem -Path .) {
if ($i.Name -notmatch "myfile_Test_read_Full_20150503.")
{ continue }
Rename-Item $i.Name -NewName ($i.BaseName.Substring(0,21) +$i.Extension -replace "-","")
}
sleep -seconds 5