Auto updating SQL Monitor

Is anyone using PowerShell for this and if so has a working script?
Tagged:

Answers

  • Alex BAlex B Posts: 1,158 Diamond 4
    Hi @AndrewL

    This documentation page https://documentation.red-gate.com/sm/installation-and-setup/automated-installation-and-updates has information on automating the install of SQL Monitor using the msi files and there are some examples at the bottom of the page using PowerShell for the different components.

    The installers can be downloaded from https://download.red-gate.com/checkforupdates/SQLMonitorWeb/ and then you would just need to do the extraction described near the top of the documentation page and then run msi as shown in the examples.

    Hope that helps!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • AndrewLAndrewL Posts: 6 Bronze 1
    Hi @Alex B

    After messing around a bit with PowerShell, one of our developers came up with this script that will download the latest installer:

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


    Was wondering if we can then just execute the downloaded file so there are no prompts?

    Regards

    Andrew
  • Alex BAlex B Posts: 1,158 Diamond 4
    Hi @AndrewL

    You would need to first extract the msi's and then if you specify the various details in the command line install I think it will run with no prompts.  See https://documentation.red-gate.com/sm/installation-and-setup/automated-installation-and-updates for more information on automating the install.

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.