Powershell - Write-Host Cmdlet



Cmdlet

Write-Host Cmdlet 用於編寫自定義訊息。

在此示例中,我們能夠看到 Write-Host Cmdlet 的實際應用。

示例

在此示例中,我們將顯示一條自定義訊息。

Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor White

輸出

你可以在綠色背景並以白色顯示偶數,它們之間用分隔符分隔。

2, -> 4, -> 6, -> 8, -> 10, -> 12
powershell_advanced_cmdlets.htm
廣告
© . All rights reserved.