i use this code to add a text to some files:
gci C:\Users\Documents\SAMPLE\* -in *.mp4,*.mkv -Recurse | % { rename-item –path $_.Fullname –Newname ( $_.basename + ' (TEST)' + $_.extension) }
it works as i want BUT it does not work with files that their name contaion "[ ]" and give me this error:
Cannot rename because item at 'C:\Users\Documents\SAMPLE\AAAAAAAAA[B].mp4' does not exist.