1
在PowerShell中V2以下返回當前編輯在PowerShell V3 CTP2 ISE中發生了什麼?
$a=$psise.CurrentPowerShellTab.Files[0]
$a.gettype().getfield("encoding","nonpublic,instance").getvalue($a)
的編碼,並與
$a=$psise.CurrentPowerShellTab.Files[0]
$a.gettype().getfield("encoding","nonpublic,instance").setvalue($a,[text.encoding]::ascii)
可以將編碼設置爲ASCII。比照this post
嘗試與PowerShell V3相同失敗。很顯然getfield()不返回對象。任何想法來解決這個問題?
它的工作原理。你能給出一個提示,如何列出所有非公開成員,或者是否值得另一個問題? – 2012-01-05 15:15:36
dotPeek或justDecompile或反射...等 – Jaykul 2012-01-06 18:09:58
或捅;-) github.com/oising/poke/ – x0n 2014-01-19 05:55:59