- PowerShell 教程
- PowerShell - 主頁
- PowerShell - 概述
- PowerShell - 環境設定
- PowerShell - Cmdlet
- PowerShell - 檔案和資料夾
- PowerShell - 日期和計時器
- PowerShell - 檔案 I/O
- PowerShell - 高階 Cmdlet
- PowerShell - 指令碼編寫
- PowerShell - 特殊變數
- PowerShell - 運算子
- PowerShell - 迴圈
- PowerShell - 條件
- PowerShell - 陣列
- PowerShell - 雜湊表
- PowerShell - Regex
- PowerShell - 反引號
- PowerShell - 括號
- PowerShell - 別名
- PowerShell 有用的資源
- PowerShell - 快速指南
- PowerShell - 有用的資源
- PowerShell - 討論
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
廣告