挖掘PowerShell中的Console界面

本文探讨了PowerShell中Console界面的特性,包括利用System.Console类检查CapsLock状态以判断键盘大写锁定是否开启,以及如何设置Console界面的背景色。通过Get-Member方法,可以查看PowerShell支持的所有静态背景色。
摘要由CSDN通过智能技术生成
在我们使用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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值