Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Newbie to PS and can't remove CRLF/blank line from end of file

$
0
0

We had a co worker that used to handle our Powershell script creation and he had helped me understand the basics, unfortunately, I am running into an issue where I have altered a script, which works, but it inserts a CRLF at the end of a string which causes an extra blank line in the output file, which the vendor cannot handle.

I've read that this could be due to how set-content works, that out-file also has similar pit falls and that [IO.File] may be my course, but I am unsure if that is true, and if so, how to implement it within the script I've created.

Any help would be greatly appreciated.

Here is the script:

Powershell
#Match and Replace string in the file#Note this will destroy your original file.#Specify source file path, the target character position and the character with which to replace it.##param([string]$sourcepath,...

Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>