Advertisement
Guest User

Untitled

a guest
Jan 13th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $FileName = "$PSScriptRoot\Update.zip"
  2. $LocalVersion = [version](Get-Content $PSScriptRoot\version.txt)
  3. $RemoteVersion = [version](Invoke-RestMethod http://domaine/version.txt)
  4.  
  5. If ($LocalVersion -lt $RemoteVersion) {
  6.     $true    
  7. (New-Object Net.WebClient).DownloadFile('http://domaine/update/Updates.zip',"$FileName ");
  8. (new-object -com shell.application).namespace("$PSScriptRoot").CopyHere((new-object -com shell.application).namespace("$FileName").Items(),16)
  9. if (Test-Path $FileName) {
  10.   Remove-Item $FileName
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement