1. 程式人生 > >Powershell 【控制臺常用方法】

Powershell 【控制臺常用方法】

shell function wsize round rsh pan oid color 常用

 1 function Pause(){
 2     [System.Console]::Write(‘按任意鍵繼續...‘)
 3     [void][System.Console]::ReadKey(1)
 4 }
 5 [System.Console]::Title=‘控制臺常用方法‘
 6 0..15|ForEach-Object{
 7     [System.Console]::SetCursorPosition($_,$_)
 8     [System.Console]::BackgroundColor=15-$_
 9     [System.Console]::ForegroundColor=$_
10 $_ 11 [System.Console]::SetCursorPosition(15+$_,15-$_) 12 [System.Console]::BackgroundColor=$_ 13 [System.Console]::ForegroundColor=15-$_ 14 15-$_ 15 } 16 [System.Console]::ResetColor() 17 [System.Console]::SetWindowSize(80,30) 18 [System.Console]::SetCursorPosition(0,16) 19 pause

Powershell 【控制臺常用方法】