Hi @Liam Tielemans ,
please try this:
# Modify path
$files = Get-ChildItem -Path Junk -filter "*.pdf*" -recurse
foreach ($file in $files)
{
$filename = $file.Name
$ext = $filename.Substring($filename.Length - 4)
$newfilename = $filename.Replace("$ext","pdf")
$file | Rename-Item -NewName $newfilename
}
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten