powershell - Convert text file to ANSI format -


i running 2 powershell scripts. 1 powershell script adds host name text file. other powershell script appends ip address of machine same file. so, .txt file looks follows: hostname ipaddress but, file being saved in unicode format default. can that, text file stored in ansi format?

i use powershell v2.0.

[system.text.encoding]::default   issinglebyte : true bodyname : iso-8859-1  encodingname : western european (windows)  headername : windows-1252  webname : windows-1252 windowscodepage : 1252 isbrowserdisplay : true isbrowsersave : true ismailnewsdisplay : true ismailnewssave : true encoderfallback : system.text.internalencoderbestfitfallback decoderfallback : system.text.internaldecoderbestfitfallback isreadonly : true  codepage : 1252  

depending on how outputting text may need set encoding type. using out-file -encoding use type of ascii. depends on version of powershell you're using.

see: ss64 out-file , set encoding ansi in powershell 2.0


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -