Powershell foreach with path not finding files
问题 I'm trying to rename files in a specific directory by my foreach block isn't finding any files. #expected encountered filename = 3000 Miles To Graceland 2001.avi $path = "D:\Media Holding\[UsaBit.com]_3000 Miles To Graceland 2001" foreach($file in Get-ChildItem $path) { "FOUND ITEM" if (!$file.PSIsContainer) { $fileName = $file.FullName -replace ("(\w.*?)([12]\d{3})", "$1 ($2)") -replace("\.", " ") -replace("\s{2,}", " ") $fileExtension = $file.FullName -replace ("[^\.]*\.(\w{3,4})$", ".$1")