powershell_check_for_updates
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| powershell_check_for_updates [2016/07/28 21:27] – stephen | powershell_check_for_updates [2017/02/07 21:27] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| <code powershell> | <code powershell> | ||
| #requires -version 3.0 | #requires -version 3.0 | ||
| - | + | ||
| #### Check for updates | #### Check for updates | ||
| - | #### Version 1.32 | + | #### Version 1.36 |
| - | #### Last updated | + | #### Last updated |
| #### The canonical version of this script is at http:// | #### The canonical version of this script is at http:// | ||
| Line 38: | Line 38: | ||
| } | } | ||
| + | function WebRequest ($url) { | ||
| + | [net.httpwebrequest]$httpwebrequest = [net.webrequest]:: | ||
| + | [net.httpWebResponse]$httpwebresponse = $httpwebrequest.getResponse() | ||
| + | |||
| + | if (!$httpwebresponse) { | ||
| + | return $null | ||
| + | } | ||
| + | |||
| + | $reader = new-object IO.StreamReader($httpwebresponse.getResponseStream()) | ||
| + | $WSResponse = $reader.ReadToEnd() | ||
| + | $reader.Close() | ||
| + | |||
| + | return $WSResponse | ||
| + | } | ||
| + | |||
| function WebRequest ($url) { | function WebRequest ($url) { | ||
| [net.httpwebrequest]$httpwebrequest = [net.webrequest]:: | [net.httpwebrequest]$httpwebrequest = [net.webrequest]:: | ||
| Line 175: | Line 190: | ||
| { | { | ||
| CheckCurrentVersionNumber ' | CheckCurrentVersionNumber ' | ||
| - | 'href=" | + | '> |
| $appsToCheck[' | $appsToCheck[' | ||
| } | } | ||
| Line 204: | Line 219: | ||
| ' | ' | ||
| { | { | ||
| - | CheckCurrentVersionNumber ' | + | CheckCurrentVersionNumber ' |
| - | '<title>Notepad\+\+ v(?< | + | '>Current Version:\s*(?:<\w+>\s*)*(?< |
| $appsToCheck[' | $appsToCheck[' | ||
| } | } | ||
| Line 211: | Line 226: | ||
| { | { | ||
| CheckCurrentVersionNumber ' | CheckCurrentVersionNumber ' | ||
| - | '> | + | '> |
| $appsToCheck[' | $appsToCheck[' | ||
| } | } | ||
| Line 261: | Line 276: | ||
| ' | ' | ||
| { | { | ||
| - | CheckLocalFile ' | + | CheckLocalFile ' |
| - | '>Version | + | '<title>\s*Chocolatey\s+Gallery\s*\|\s*Fiddler\s*(?< |
| $appsToCheck[' | $appsToCheck[' | ||
| '; | '; | ||
| Line 343: | Line 358: | ||
| { | { | ||
| CheckLocalFile ' | CheckLocalFile ' | ||
| - | '> | + | '\>\s*VirtualBox\s*(?< |
| $appsToCheck[' | $appsToCheck[' | ||
| '; | '; | ||
| Line 355: | Line 370: | ||
| ' | ' | ||
| { | { | ||
| - | CheckLocalFile ' | + | CheckLocalFile ' |
| - | '>\s*VeraCrypt version | + | '>Latest Stable Release - (?< |
| $appsToCheck[' | $appsToCheck[' | ||
| } | } | ||
| Line 364: | Line 379: | ||
| ' | ' | ||
| $appsToCheck[' | $appsToCheck[' | ||
| + | } | ||
| + | ' | ||
| + | { | ||
| + | CheckLocalFile ' | ||
| + | ' | ||
| + | $appsToCheck[' | ||
| + | '; | ||
| } | } | ||
| default | default | ||
powershell_check_for_updates.1469741270.txt.gz · Last modified: 2017/01/01 19:51 (external edit)
