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.
Comments
Post a Comment