Dbatools: Option to download updates when running Update-DbaInstance

Created on 4 Feb 2019  路  4Comments  路  Source: sqlcollaborative/dbatools


name: Option to download updates when running Update-DbaInstance.

Summary of new feature

  • ability to download updates from microsoft update catalog instead of relying on pre-downloaded updates in local folders.

Proposed technical details (if applicable)

Latest version of dbatools as of writing

  • 0.9.752
Feature

All 4 comments

I like the idea and it actually was there in the early blueprints of the function. However, it seems that the code isn't working as expected - at least for me. I'm getting:

Get-WUFileById : No candidate rows have been found for KB 4475776
At line:1 char:1
+ Get-WUFileById -KB 4475776 -SearchCriteria 'SQL Server 2016'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-WUFileByID

I'm fine with adding something like this to the function, as long as it works and I don't need to support web parsing :D

@bigbearzhu - do you have any additional code/info that can help @nvarscar ?

@nvarscar working for me, give it another try?

PS C:\Dev\dbatools> Get-WUFileByID -KB 4495256 -SearchCriteria 'SQL Server*'

Directory: C:\Dev\dbatools

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/06/2019 13:56 748919880 sqlserver2016-kb4495256-x64_f1b206222329d623c55c8fac16851a76b6247df3.exe

Apparently this function errors out when running on PS6.0+ by default:

    if($PSVersionTable.PSEdition -eq 'Core')
    {
        throw 'The script uses Internet Explorer engine and, therefore, requires the Desktop edition of PowerShell'
    } 

I'm not sure if there are any plans to support Core edition. Can anyone who has an experience with Invoke-WebRequest in 6.0+ check if the script can be ported to 6.0 at all?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SQLDataCloud picture SQLDataCloud  路  4Comments

cporteou picture cporteou  路  7Comments

potatoqualitee picture potatoqualitee  路  10Comments

llmuculusll picture llmuculusll  路  4Comments

joshcorr picture joshcorr  路  9Comments