IT漫步

技术生活札记©Yaohui

Powershell: Copy-Item doesn’t work when file name contains square bracket ([]) characters

I have a file whose name contains square bracket characters, and I want to copy the file to another location via Powershell. So I use the Copy-Item founcation to do this. like this: Copy-Item -Path "C:\FileTest\1\[Control]Test.txt" -Destination "C:\FileTest\2\[Control]Update.txt" No errors occurred when executing the script, but the target file was not copied either. After looking …

Proudly powered by WordPress