How to make Powershell ISE support colors and non-ASCII characters? -
here sample output windows powershell when run grunt task in project directory:
done, without errors. execution time (2015-08-25 01:57:14 utc) loading tasks 9ms ██████ 17% loading grunt-contrib-copy 23ms ███████████████ 43% copy:styles 20ms █████████████ 38% total 53ms running "autoprefixer:server" (autoprefixer) task autoprefixer's process() method deprecated , removed in next major release. use postcss([autoprefixe r]).process() instead file .tmp/styles/main.css created.
"done, without errors" in green , ".tmp/styles/main.css" in cyan.
running same command in powershell ise, produces following:
[32mdone, without errors.[39m execution time (2015-08-25 01:58:40 utc) loading tasks 9ms ███████ 20% loading grunt-contrib-copy 20ms ████████████████ 45% copy:styles 14ms ███████████ 32% total 44ms [4mrunning "autoprefixer:server" (autoprefixer) task[24m grunt : autoprefixer's process() method deprecated , removed in next major release. use postcss([autoprefixer]).process() instead @ line:1 char:1 + grunt serve + ~~~~~~~~~~~ + categoryinfo : notspecified: (autoprefixer's ...ocess() instead:string) [], remoteexception + fullyqualifiederrorid : nativecommanderror file .tmp/styles/main.css created.
colors not interpreted correctly, , neither non-ascii characters.
i have tried searching solution, no success. how can make powershell ise behave more powershell? seem ps ise wrapper around regular ps, there must more that.
update: came across this post says "console application output not colorful". mean there no way powershell-like output through powershell ise?
i question why want work in powershell ise begin with. can see correct output while developing/debugging it, while normal execution gets done in powershell.exe
?
if so, workaround putting @ top of script:
if ($host.name -like '*ise*') { start-process -filepath powershell.exe -argumentlist '-noexit','-executionpolicy',(get-executionpolicy),'-file',$pscommandpath return }
essentially, whenever run script within ise, run script in new powershell console host instead.
Comments
Post a Comment