在我们使用PowerShell的时候,最常见到的必定是我们的PowerShell Console界面,比如你会看到默认深蓝色的底色,白色的字体以及其它各种你在Console界面中所见到的一切。
今天我们就来挖掘下PowerShell中Console界面的一些特性。我们可以使用如下System.Console类在PowerShell中查看下控制台的一些支持属性:
PS C:\Users\Administrator> [System.Console].Getmembers()|Foreach{$_.name}
get_IsInputRedirected
get_IsOutputRedirected
get_IsErrorRedirected
get_In
get_Out
get_Error
get_InputEncoding
set_InputEncoding
get_OutputEncoding
set_OutputEncoding
get_BackgroundColor
set_BackgroundColor
set_ForegroundColor
get_ForegroundColor
set_BufferHeight
get_BufferHeight
get_BufferWidth
set_BufferWidth
get_WindowHeight
set_WindowHeight
get_WindowWidth
set_WindowWidth
get_LargestWindowWidth
get_LargestWindowHeight
set_WindowLeft
get_WindowLeft
set_WindowTop
get_WindowTop
get_CursorLeft
set_CursorLeft
get_Curs