PowerShell 7.3 - how to to Append to a File Using Add-Content with Special Characters in the Path
I'm sure I'm missing something obvious here, but I'm not sure how to approach I'm stuck on something that should probably be simple... I'm trying to use the `Add-Content` cmdlet in PowerShell 7.3 to append text to a file, but I'm working with issues when the file path includes special characters. Specifically, my file path is `C:\Users\John Doe\Documents\Test Files\output.txt`, and whenever I run the following command: ```powershell Add-Content -Path 'C:\Users\John Doe\Documents\Test Files\output.txt' -Value 'New Line of Text' ``` I get the behavior message: ``` Add-Content : The path is not of a legal form. ``` I've tried surrounding the path in double quotes, as well as removing the spaces and using the short path format (e.g., `C:\Users\JOHNDO~1\Documents\Test~1\output.txt`), but none of those solutions worked. I've even checked file permissions to ensure that I have write access to the directory. I also tried using `Set-Content` instead, but I faced the same scenario. Can someone suggest how I can properly append text to a file when the path contains spaces or special characters? Are there any specific escaping mechanisms or best practices I should follow in this scenario? This issue appeared after updating to Powershell 3.9. Could someone point me to the right documentation? This issue appeared after updating to Powershell latest. Any help would be greatly appreciated!