How do you use cloud databases? Take the survey.

Automatics Updates

Has anyone ever managed to get this to work? I've tried to follow the instructions here:

https://documentation.red-gate.com/sm12/installation-and-setup/automated-installation-and-updates

Was hoping someone had already done a PowerShell script
Tagged:

Answers

  • Hi AndrewL

    What part of this is causing issue? Please note though you will still have to download the latest installer each time. 
  • AndrewLAndrewL Posts: 6 Bronze 1
    Let me share what I have no far. This will download the latest version and extract it:

    <div>$awsroot = "http://redgate-download.s3.eu-west-1.amazonaws.com/"</div><div>$awsquery = "?delimiter=/&prefix=checkforupdates/SQLMonitorWeb/"</div><div><br></div><div>$xml = new-object System.Xml.XmlDocument</div><div>$xml.load($awsroot + $awsquery)</div><div><br></div><div>$sortedcontents = $xml.ListBucketResult.Contents | where-object {$_.key -notlike "*.sha256"} | sort-object -Property LastModified -Descending</div><div><br></div><div>write-host $sortedcontents[0].Key</div><div><br></div><div>$url = $awsroot + $sortedcontents[0].Key</div><div><br></div><div>$filename = $sortedcontents[0].Key.Substring($sortedcontents[0].key.lastindexof("/") + 1)</div><div><br></div><div>Invoke-WebRequest -UseBasicParsing -Uri $url -Method GET -OutFile "C:\Temp\$filename"</div><div><br></div><div>cd \Temp</div><div><br></div><div>& C:\Temp\$filename /IAgreeToTheEULA extract web.msi</div>

    I tried curl but couldn't get it to work. Also PowerShells Invoke-WebRequest isn't the quickest either.
  • Hi AndrewL

    Could you try using "https://download.red-gate.com/checkforupdates/SQLMonitor.exe" as your download location?
Sign In or Register to comment.