I'm trying to exclude any file with "Confidential" in the name from being renamed by this script which batch renames files in a folder.
However, when I try this script the file names with "Confidential" in it don't change, nor do the ones without "Confidential" in it.
Get-ChildItem -Exclude "*Confidential*" | rename-item -NewName { $_.BaseName + " - Confidential" +$_.Extension }