Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $FileName = "$PSScriptRoot\Update.zip"
- $LocalVersion = [version](Get-Content $PSScriptRoot\version.txt)
- $RemoteVersion = [version](Invoke-RestMethod http://domaine/version.txt)
- If ($LocalVersion -lt $RemoteVersion) {
- $true
- (New-Object Net.WebClient).DownloadFile('http://domaine/update/Updates.zip',"$FileName ");
- (new-object -com shell.application).namespace("$PSScriptRoot").CopyHere((new-object -com shell.application).namespace("$FileName").Items(),16)
- if (Test-Path $FileName) {
- Remove-Item $FileName
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement