I am trying to run a script remotely using Powershell, the script still runs, but I receive an error Invoke Command : Window Title cannot be longer than 1023 characters.
Here is my code:
Invoke-Command -ComputerName Test -FilePath "\\Some\File\Path.ps1"
I realize what is occuring when running the line in ISE, it places the comments in the header
of the script into the files name. Is there a way to prevent this action? I can use the option ErrorAction SilentlyContinue
which suppresses the error, but it also suppresses all other errors which is not ideal.
This web link albeit VBS, does provide clarity and a walk-through for your situation.
This is a more common situation/issue than you would think.
HTH,
Kent