when relevant content is
added and updated.
Interesting question on the forum regarding finding files with a file name starting with a space.
First problem was creating some files to match the criteria. Renaming in file explorer didn’t work so back to PowerShell
PS> Rename-Item -Path C:\test\file1.txt -NewName "C:\test\ file1.txt" PS> Rename-Item -Path C:\test\junk.txt -NewName "C:\test\ junk.txt"
Make sure you put the new name in quotes so the space is included as part of the file name
After that its actually quite easy
PS> Get-ChildItem -Path C:\test\ -Filter ' *.txt' Directory: C:\test Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 30/06/2017 15:38 16 file1.txt -a---- 30/06/2017 10:50 26 junk.txt
Use the Filter parameter and specify ‘ *.txt’ as the pattern you want to match