Welcome

首页 / 编程脚本 / PowerShell实现在控制台中插入绿色的打勾符号

在前面的PowerShell技巧中,我们看到了PowerShell控制台支持输出所有TrueType字体的字符,你只需将你的字符代码转换成Char类型。今天再来一个更高级的例子,让用户在控制台中插入绿色的打勾符号。
$greenCheck = @{ Object = [Char]8730 ForegroundColor = "Green" NoNewLine = $true } Write-Host "Status check... " -NoNewlineStart-Sleep -Seconds 1Write-Host @greenCheckWrite-Host " (Done)"

所以,什么时候想使用绿色的对号了,只需:
Write-Host @greenCheck