I have a file share with McAfee FRP encrypted files and folders and due to an unknown issue, some of the files were added with a special character '' in the ending of their files names.(example: helloworld.txt instead of helloworld.txt) I am tryng to find out the files that do not have the special char '' in the ending of the file name.

I have tried using the below powershell command to find the files ending with ''.

Here is the command: Get-ChildItem * . * -Recurse

However, I want to find the files not ending with special character '' and I am unable to negate the above command to get what I want using (NOT, ! and ~)

Files in the folder are as below:

helloworld.ppt, McAfee_test.txt, Data.txt, testabc.xlxs, doneDone.jpeg, test1.txt, hello.xml, ok123.mp3

The above comand will return the below result:

test1.txt, testabc.xlxs, helloworld.ppt, ok123.mp3

Which command will retun the below result ?

McAfee_test.txt, Data.txt, doneDone.jpeg, hello.xml

1 Answers

mklement0 On

Use the -Exclude parameter:

Get-ChildItem -File -Recurse -Exclude *