PowerShell实现在控制台中插入绿色的打勾符号
在前面的PowerShell技巧中,我们看到了PowerShell控制台支持输出所有TrueType字体的字符,你只需将你的字符代码转换成Char类型。今天再来一个更高级的例子,让用户在控制台中插入绿色的打勾符号。
$greenCheck = @{ Object = [Char]8730 ForegroundColor = 'Green' NoNewLine = $true } Write-Host "Status check... " -NoNewline Start-Sleep -Seconds 1 Write-Host @greenCheck Write-Host " (Done)"
所以,什么时候想使用绿色的对号了,只需:
Write-Host @greenCheck
相关推荐
huha 2020-10-16
lianshaohua 2020-09-23
higheels 2020-08-03
ZoctopusD 2020-08-03
酷云的csdn 2020-08-03
higheels 2020-07-27
liushun 2020-06-28
zhendeshifeng 2020-06-22
Sabrina 2020-06-11
CARBON 2020-06-03
CARBON 2020-06-01
DBATips 2020-05-31
higheels 2020-05-29
applecarelte 2020-04-15
Yyqingmofeige 2020-03-28
yoshubom 2020-03-06
Yyqingmofeige 2020-03-02
SciRui 2020-02-26