I have a bunch of small PowerShell functions, each in their own file and I am trying to combine them into a larger file.
Using the low-tech approach of the Windows copy command by doing: copy /Y /A functions\*.ps1 super.ps1
works fine however where two files are joined it is inserting: 
I'm guessing it's the line break characters showing up (difference of encoding), but how do I prevent these characters from showing up?
How you tried /B for binary to stop OEM characterset translation
Who knows
Or open your scripts in notepad and save them as ANSI then try and join them with your normal copy command no /B required
Those characters are unicode byte order marks which will be invisibly preceding the .ps1 content.
I'm not sure how you'd strip them off in plain DOS -- at this point I'd turn to a scripting language to do the work. You could write a PowerShell script to join them using the .net System.IO features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With