我想在一个CSV或TXT结果从下面的PowerShell命令列出:PowerShell的名单成绩
Show_Proxy.ps1
:
Invoke-Expression "netsh winhttp show proxy"
Server_Name.txt
:
Server01 Server02 Server03
$ServerList = Get-Content C:\temp\Server_Names.txt
Invoke-Command -FilePath C:\temp\Show_Proxy.ps1 -CN $ServerList
我确实看到结果,但希望有一个列出服务器名称的文件,以及它是否具有代理服务器的天气。
PS C:\Windows> $ServerList= Get-Content C:\temp\Server_Names.txt PS C:\Windows> Invoke-Command -FilePath C:\temp\Show_Proxy.ps1 -CN $ServerList Current WinHTTP proxy settings: Proxy Server(s) : Proxy_Server_Name:8080 Bypass List : Current WinHTTP proxy settings: Proxy Server(s) : Proxy_Server_Name:8080 Bypass List : Current WinHTTP proxy settings: Direct access (no proxy server).