본문 바로가기

Windows 10/PowerShell

PowerShell : 입력 & 출력

반응형

- 간단한 입력

$input = Read-Host "입력해줘~"

- 간단한 출력

Write-Host "출력해줘~"

- 출력값 색 바꾸기

Write-Host "출력해줘~" -foregroundcolor green
Write-Host "출력해줘~" -backgroundcolor green

- 변경 가능한 색 목록

Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White

 

 

 

Write-Host (Microsoft.PowerShell.Utility)

The Write-Host cmdlet customizes output. You can specify the color of text by using the ForegroundColor parameter, and you can specify the background color by using the BackgroundColor parameter. The Separator parameter lets you specify a string to use to

docs.microsoft.com

 

Read-Host (Microsoft.PowerShell.Utility)

The Read-Host cmdlet reads a line of input from the console. You can use it to prompt a user for input. Because you can save the input as a secure string, you can use this cmdlet to prompt users for secure data, such as passwords, as well as shared data.

docs.microsoft.com

 

반응형

'Windows 10 > PowerShell' 카테고리의 다른 글

PowerShell : Switch  (0) 2019.06.14
PowerSehll : For, While, Break  (0) 2019.06.14
PowerShell : If, ElseIf, Else  (0) 2019.06.14
PowerShell : 주석 처리  (0) 2019.06.14
PowerShll : 관리자로 실행  (0) 2019.06.14