ผู้ตอบมากที่สุด
using color with Read-Host

คำถาม
-
คำตอบ
-
Write-Host "Select an option or type" -NoNewline Write-Host " [quit] " -ForegroundColor Yellow -NoNewline Write-Host "to exit: " -NoNewline $input = Read-Host
- เสนอเป็นคำตอบโดย Bigteddy 3 เมษายน 2555 14:48
- ทำเครื่องหมายเป็นคำตอบโดย tickermcse76 3 เมษายน 2555 15:21
ตอบทั้งหมด
-
- เสนอเป็นคำตอบโดย Kazun 3 เมษายน 2555 14:47
-
Write-Host "Select an option or type" -NoNewline Write-Host " [quit] " -ForegroundColor Yellow -NoNewline Write-Host "to exit: " -NoNewline $input = Read-Host
- เสนอเป็นคำตอบโดย Bigteddy 3 เมษายน 2555 14:48
- ทำเครื่องหมายเป็นคำตอบโดย tickermcse76 3 เมษายน 2555 15:21
-
-
There is no easy way, but following copy/paste function should help.
function take_input() { param ( [Parameter(Position = 0, ValueFromPipeline = $true)] [string]$msg, [string]$BackgroundColor = "Black", [string]$ForegroundColor = "DarkGreen" ) Write-Host -ForegroundColor $ForegroundColor -NoNewline $msg; return Read-Host } $choice = take_input 'Perform setup? [Y/N]'
- แก้ไขโดย Ashish Agrawal at Toshal 17 พฤศจิกายน 2562 12:42 Code block