How to output something in PowerShell

前端 未结 7 975
北恋
北恋 2020-12-04 07:43

I am running a PowerShell script from within a batch file. The script fetches a web page and checks whether the page\'s content is the string \"OK\".

The PowerShell

7条回答
  •  渐次进展
    2020-12-04 08:27

    Write-Host "Found file - " + $File.FullName -ForegroundColor Magenta
    

    Magenta can be one of the "System.ConsoleColor" enumerator values - Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White.

    The + $File.FullName is optional, and shows how to put a variable into the string.

提交回复
热议问题