Character-encoding problem with string literal in source code

Note: Remoting and use of Invoke-Command are incidental to your problem. Since the problem occurs with a string literal in your source code (…\01_Klassenbücher\…), the likeliest explanation is that your script file is misinterpreted by PowerShell. In Windows PowerShell, if your script file is de facto UTF-8-encoded but lacks a BOM, the PowerShell engine will … Read more

How do I pass named parameters with Invoke-Command?

-ArgumentList is based on use with scriptblock commands, like: Invoke-Command -Cn (gc Servers.txt) {param($Debug=$False, $Clear=$False) C:\Scripts\ArchiveEventLogs\ver5\ArchiveEventLogs.ps1 } -ArgumentList $False,$True When you call it with a -File it still passes the parameters like a dumb splatted array. I’ve submitted a feature request to have that added to the command (please vote that up). So, you have … Read more