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

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -