![將前景色添加到 Powershell 設定檔?](https://rvso.com/image/1586625/%E5%B0%87%E5%89%8D%E6%99%AF%E8%89%B2%E6%B7%BB%E5%8A%A0%E5%88%B0%20Powershell%20%E8%A8%AD%E5%AE%9A%E6%AA%94%EF%BC%9F.png)
答案1
這只能透過使用 來實現Write-Host
。
例如,這個簡單的 Prompt 方法將提示的顏色設為黃色:
function Prompt
{
$promptString = "PS " + $(Get-Location) + ">"
Write-Host $promptString -NoNewline -ForegroundColor Yellow
return " "
}
這只能透過使用 來實現Write-Host
。
例如,這個簡單的 Prompt 方法將提示的顏色設為黃色:
function Prompt
{
$promptString = "PS " + $(Get-Location) + ">"
Write-Host $promptString -NoNewline -ForegroundColor Yellow
return " "
}