Auto-Update your framework

It’s easy to auto-update your framework in PowerShell.

Here’s a function that will do just that, given that you have another one to upload your 7-zip sfx (self-extracting) .exe archive automatically, in another script:

function Auto-Update() {    
    Param (
        $file="filename.extension",
        $link="https://mycdn/myfolder/subfolder"
    )    
    Invoke-WebRequest -Uri "$link/$file" -OutFile ".\$file" #-Verbose
    Start-Process -FilePath ".\$file" -ArgumentList ('-o"' + ".\" + '" -y') -Wait -WindowStyle Minimized
}
0
Rename-Computer.ps1 Resource management in your PowerShell framework

No Comments

No comments yet

Leave a Reply

Your email address will not be published. Required fields are marked *