diff --git a/docs/Update-DellBios.md b/docs/Update-DellBios.md index 5ddf0ed..55c3e0a 100644 --- a/docs/Update-DellBios.md +++ b/docs/Update-DellBios.md @@ -16,19 +16,27 @@ Downloads and creates a configmgr standard package containing the latest Bios up ``` Update-DellBios -Model [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN -DistributionPoints -DistributionPointGroups - [] + [-ProgressAction ] [] ``` ### DistributionPoints ``` Update-DellBios -Model [-WorkingDir ] -ContentShare -SiteCode - -SiteServerFQDN -DistributionPoints [] + -SiteServerFQDN -DistributionPoints [-ProgressAction ] + [] ``` ### DistributionPointGroups ``` Update-DellBios -Model [-WorkingDir ] -ContentShare -SiteCode - -SiteServerFQDN -DistributionPointGroups [] + -SiteServerFQDN -DistributionPointGroups [-ProgressAction ] + [] +``` + +### DownloadOnly +``` +Update-DellBios -Model [-WorkingDir ] -ContentShare [-DownloadOnly] + [-ProgressAction ] [] ``` ## DESCRIPTION @@ -53,7 +61,7 @@ Specifies the path of the content. The site system server requires permission to ```yaml Type: DirectoryInfo Parameter Sets: (All) -Aliases: +Aliases: Destination Required: True Position: Named @@ -112,7 +120,7 @@ Specify the sitecode of the confimgr site to connect to. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: PointAndGroup, DistributionPoints, DistributionPointGroups Aliases: Required: True @@ -127,7 +135,7 @@ Specify the site server fqdn to connect to. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: PointAndGroup, DistributionPoints, DistributionPointGroups Aliases: Required: True @@ -152,6 +160,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DownloadOnly +Only downloads the BIOS update to the specified ContentShare. Does not create a package in configmgr. + +```yaml +Type: SwitchParameter +Parameter Sets: DownloadOnly +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/docs/Update-DellDriver.md b/docs/Update-DellDriver.md index 5d3ac9e..763ba1a 100644 --- a/docs/Update-DellDriver.md +++ b/docs/Update-DellDriver.md @@ -16,21 +16,27 @@ Downloads the latest driver package for the specified operating system version a ``` Update-DellDriver -Model -OSVersion [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN -DistributionPoints - -DistributionPointGroups [] + -DistributionPointGroups [-ProgressAction ] [] ``` ### DistributionPoints ``` Update-DellDriver -Model -OSVersion [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN -DistributionPoints - [] + [-ProgressAction ] [] ``` ### DistributionPointGroups ``` Update-DellDriver -Model -OSVersion [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN -DistributionPointGroups - [] + [-ProgressAction ] [] +``` + +### DownloadOnly +``` +Update-DellDriver -Model -OSVersion [-WorkingDir ] + -ContentShare [-DownloadOnly] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -55,7 +61,7 @@ Specifies the path of the content. The site system server requires permission to ```yaml Type: DirectoryInfo Parameter Sets: (All) -Aliases: +Aliases: Destination Required: True Position: Named @@ -130,7 +136,7 @@ Specify the sitecode of the confimgr site to connect to. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: PointAndGroup, DistributionPoints, DistributionPointGroups Aliases: Required: True @@ -145,7 +151,7 @@ Specify the site server fqdn to connect to. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: PointAndGroup, DistributionPoints, DistributionPointGroups Aliases: Required: True @@ -170,6 +176,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DownloadOnly +Only downloads the driver package to the specified ContentShare. Does not create a package in configmgr. + +```yaml +Type: SwitchParameter +Parameter Sets: DownloadOnly +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/docs/Update-MicrosoftDriver.md b/docs/Update-MicrosoftDriver.md index 96b9969..27f563e 100644 --- a/docs/Update-MicrosoftDriver.md +++ b/docs/Update-MicrosoftDriver.md @@ -16,21 +16,27 @@ Downloads the latest driver packge for the specified operating system version an ``` Update-MicrosoftDriver -Model -OSVersion [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN -DistributionPoints - -DistributionPointGroups [] + -DistributionPointGroups [-ProgressAction ] [] ``` ### DistributionPoints ``` Update-MicrosoftDriver -Model -OSVersion [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN -DistributionPoints - [] + [-ProgressAction ] [] ``` ### DistributionPointGroups ``` Update-MicrosoftDriver -Model -OSVersion [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN -DistributionPointGroups - [] + [-ProgressAction ] [] +``` + +### DownloadOnly +``` +Update-MicrosoftDriver -Model -OSVersion [-WorkingDir ] + -ContentShare [-DownloadOnly] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -55,7 +61,7 @@ Specifies the path of the content. The site system server requires permission to ```yaml Type: DirectoryInfo Parameter Sets: (All) -Aliases: +Aliases: Destination Required: True Position: Named @@ -130,7 +136,7 @@ Specify the sitecode of the confimgr site to connect to. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: PointAndGroup, DistributionPoints, DistributionPointGroups Aliases: Required: True @@ -145,7 +151,7 @@ Specify the site server fqdn to connect to. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: PointAndGroup, DistributionPoints, DistributionPointGroups Aliases: Required: True @@ -170,6 +176,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DownloadOnly +Only downloads the driver package to the specified ContentShare. Does not create a package in configmgr. + +```yaml +Type: SwitchParameter +Parameter Sets: DownloadOnly +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/docs/Update-Model.md b/docs/Update-Model.md index 510ef15..fb874d9 100644 --- a/docs/Update-Model.md +++ b/docs/Update-Model.md @@ -16,21 +16,29 @@ Controller script to assist with automating the usage of the manufactuer specifi ``` Update-Model -Make -Model -OSVersion [-DownloadType ] [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN - -DistributionPoints -DistributionPointGroups [] + -DistributionPoints -DistributionPointGroups [-ProgressAction ] + [] ``` ### DistributionPoints ``` Update-Model -Make -Model -OSVersion [-DownloadType ] [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN - -DistributionPoints [] + -DistributionPoints [-ProgressAction ] [] ``` ### DistributionPointGroups ``` Update-Model -Make -Model -OSVersion [-DownloadType ] [-WorkingDir ] -ContentShare -SiteCode -SiteServerFQDN - -DistributionPointGroups [] + -DistributionPointGroups [-ProgressAction ] [] +``` + +### DownloadOnly +``` +Update-Model -Make -Model -OSVersion [-DownloadType ] + [-WorkingDir ] -ContentShare [-DownloadOnly] + [-ProgressAction ] [] ``` ## DESCRIPTION @@ -55,7 +63,7 @@ Specifies the path of the content. The site system server requires permission to ```yaml Type: DirectoryInfo Parameter Sets: (All) -Aliases: +Aliases: Destination Required: True Position: Named @@ -162,7 +170,7 @@ Specify the sitecode of the confimgr site to connect to. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: PointAndGroup, DistributionPoints, DistributionPointGroups Aliases: Required: True @@ -177,7 +185,7 @@ Specify the site server fqdn to connect to. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: PointAndGroup, DistributionPoints, DistributionPointGroups Aliases: Required: True @@ -202,6 +210,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DownloadOnly +Downloads only the file specified in DownloadType to the ContentShare. + +```yaml +Type: SwitchParameter +Parameter Sets: DownloadOnly +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/source/OpenDriverTool.psd1 b/source/OpenDriverTool.psd1 index 99d3f2d..a4dd78a 100644 --- a/source/OpenDriverTool.psd1 +++ b/source/OpenDriverTool.psd1 @@ -12,7 +12,7 @@ RootModule = 'OpenDriverTool.psm1' # Version number of this module. -ModuleVersion = '0.4.1' +ModuleVersion = '0.5.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/source/public/Update-DellBios.ps1 b/source/public/Update-DellBios.ps1 index c215ce0..978a192 100644 --- a/source/public/Update-DellBios.ps1 +++ b/source/public/Update-DellBios.ps1 @@ -10,15 +10,23 @@ function Update-DellBios { [io.directoryInfo] $WorkingDir, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DownloadOnly')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] + [Alias('Destination')] [io.directoryInfo] $ContentShare, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [string] $SiteCode, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [string] $SiteServerFQDN, @@ -32,7 +40,11 @@ function Update-DellBios { [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [ValidateNotNullOrEmpty()] [string[]] - $DistributionPointGroups + $DistributionPointGroups, + + [Parameter(Mandatory, ParameterSetName = 'DownloadOnly')] + [switch] + $DownloadOnly ) if (-not $WorkingDir) { @@ -61,6 +73,11 @@ function Update-DellBios { [xml] $CatalogPC = Get-Content -Path "$WorkingDir\Content\CatalogPC.xml" $BIOS = Find-DellBIOS -Model $Model -DriverPackCatalog $DriverPackCatalog -CatalogPC $CatalogPC + + if (-not $BIOS) { + Write-Error -Message "Failed to find BIOS. Please verify the name of your model is correct." -ErrorAction Stop + } + ' Found BIOS: {0}' -f $BIOS.path | Log $BIOSPackage = @{ @@ -70,9 +87,17 @@ function Update-DellBios { Description = '(Models included:{0})' -f ($BIOS.SupportedSystems.Brand.Model.systemID -join ';') } - Connect-SCCM -SiteCode $SiteCode -SiteServerFQDN $SiteServerFQDN + if ($PSCmdlet.ParameterSetName -ne 'DownloadOnly') { + Connect-SCCM -SiteCode $SiteCode -SiteServerFQDN $SiteServerFQDN + $ExistingPackage = Confirm-ExistingPackage -Package $BIOSPackage -SiteCode $SiteCode + } + + if ($ExistingPackage) { + ' Latest driver already in configmgr.' | Log + return + } - if (-not (Confirm-ExistingPackage -Package $BIOSPackage -SiteCode $SiteCode) -and $BIOS) { + if ($PSCmdlet.ParameterSetName -ne 'DownloadOnly') { $Flash64Url = 'https://downloads.dell.com/FOLDER08405216M/1/Ver3.3.16.zip' @@ -106,7 +131,16 @@ function Update-DellBios { 'DistributionPointGroups' { Start-ContentDistribution -CMPackage $CMPackage -SiteCode $SiteCode -DistributionPointGroups $DistributionPointGroups } } - } else { - ' Latest bios already in configmgr.' | Log + } + + if ($PSCmdlet.ParameterSetName -eq 'DownloadOnly') { + if (-not (Test-Path $ContentShare)) { + New-Item -Path $ContentShare -ItemType Directory | Out-Null + } + + ' Downloading: {0}' -f $BIOS.path | Log + $BIOSFile = Get-RemoteFile -Url ('{0}/{1}' -f 'https://downloads.dell.com', $BIOS.path) -Destination $ContentShare -Hash $BIOS.hashMD5 -Algorithm MD5 + + ' Downloaded: {0}' -f $BIOSFile.FullName | Log } } diff --git a/source/public/Update-DellDriver.ps1 b/source/public/Update-DellDriver.ps1 index d563ad4..649c3e6 100644 --- a/source/public/Update-DellDriver.ps1 +++ b/source/public/Update-DellDriver.ps1 @@ -15,15 +15,23 @@ function Update-DellDriver { [io.directoryInfo] $WorkingDir, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DownloadOnly')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] + [Alias('Destination')] [io.directoryInfo] $ContentShare, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [string] $SiteCode, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [string] $SiteServerFQDN, @@ -37,7 +45,11 @@ function Update-DellDriver { [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [ValidateNotNullOrEmpty()] [string[]] - $DistributionPointGroups + $DistributionPointGroups, + + [Parameter(Mandatory, ParameterSetName = 'DownloadOnly')] + [switch] + $DownloadOnly ) if (-not $WorkingDir) { @@ -59,6 +71,11 @@ function Update-DellDriver { [xml] $DriverPackCatalog = Get-Content -Path "$WorkingDir\Content\DriverPackCatalog.xml" $Driver = Find-DellDrivers -DriverPackCatalog $DriverPackCatalog -Model $Model -OSVersion ($OSVersion -replace '\s', '') + + if (-not $Driver) { + Write-Error "Failed to find a driver. Verify that the name of the model is correct and a pack is published for $OSVersion" -ErrorAction Stop + } + ' Found Driver: {0}' -f $Driver.path | Log $DriverPackage = @{ @@ -68,10 +85,17 @@ function Update-DellDriver { Description = '(Models included:{0})' -f ($Driver.SupportedSystems.brand.model.systemID -join ';') } - Connect-SCCM -SiteCode $SiteCode -SiteServerFQDN $SiteServerFQDN + if ($PSCmdlet.ParameterSetName -ne 'DownloadOnly') { + Connect-SCCM -SiteCode $SiteCode -SiteServerFQDN $SiteServerFQDN + $ExistingPackage = Confirm-ExistingPackage -Package $DriverPackage -SiteCode $SiteCode + } - if (-not (Confirm-ExistingPackage -Package $DriverPackage -SiteCode $SiteCode) -and $Driver) { + if ($ExistingPackage) { + ' Latest driver already in configmgr.' | Log + return + } + if ($PSCmdlet.ParameterSetName -ne 'DownloadOnly') { "`n Driver version not found in configmgr" | Log ' Downloading: {0}' -f $Driver.path | Log @@ -104,7 +128,17 @@ function Update-DellDriver { 'DistributionPointGroups' { Start-ContentDistribution -CMPackage $CMPackage -SiteCode $SiteCode -DistributionPointGroups $DistributionPointGroups } } - } else { - ' Latest driver already in confimgr.' | Log } + + if ($PSCmdlet.ParameterSetName -eq 'DownloadOnly') { + if (-not (Test-Path $ContentShare)) { + New-Item -Path $ContentShare -ItemType Directory | Out-Null + } + + ' Downloading: {0}' -f $Driver.path | Log + $DriverFile = Get-RemoteFile -Url ('{0}/{1}' -f 'https://downloads.dell.com', $Driver.path) -Destination $ContentShare -Hash $Drivers.hashMD5 -Algorithm MD5 + + ' Downloaded: {0}' -f $DriverFile.FullName | Log + } + } diff --git a/source/public/Update-MicrosoftDriver.ps1 b/source/public/Update-MicrosoftDriver.ps1 index c0da006..ed177d7 100644 --- a/source/public/Update-MicrosoftDriver.ps1 +++ b/source/public/Update-MicrosoftDriver.ps1 @@ -15,18 +15,26 @@ function Update-MicrosoftDriver { [io.directoryInfo] $WorkingDir, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DownloadOnly')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] + [Alias('Destination')] [io.directoryInfo] $ContentShare, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [string] $SiteCode, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [string] $SiteServerFQDN, - + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [ValidateNotNullOrEmpty()] @@ -37,7 +45,11 @@ function Update-MicrosoftDriver { [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [ValidateNotNullOrEmpty()] [string[]] - $DistributionPointGroups + $DistributionPointGroups, + + [Parameter(Mandatory, ParameterSetName = 'DownloadOnly')] + [switch] + $DownloadOnly ) if (-not $WorkingDir) { @@ -46,17 +58,13 @@ function Update-MicrosoftDriver { "Updating drivers for Microsoft $Model" | Log - Path-Creator -Parent $WorkingDir -Child 'Content' | Out-Null - ' Checking catalog for available driver.' | Log $Driver = Find-MicrosoftDriver -Model $Model -OSVersion $OSVersion if (-not $Driver) { - ' Unable to find a driver for the specified model.' | Log - ' Please reference https://raw.githubusercontent.com/OSDeploy/OSD/master/Catalogs/MicrosoftDriverPackCatalog.json for "Product" models.' | Log - return - } + Write-Error -Message 'Unable to find a driver for the specified model. Please reference https://raw.githubusercontent.com/OSDeploy/OSD/master/Catalogs/MicrosoftDriverPackCatalog.json for "Product" models.' -ErrorAction Stop + } ' Found Driver: {0}' -f $Driver.FileName | Log @@ -67,9 +75,17 @@ function Update-MicrosoftDriver { Description = '(Models included:{0})' -f $Driver.Product } - Connect-SCCM -SiteCode $SiteCode -SiteServerFQDN $SiteServerFQDN + if ($PSCmdlet.ParameterSetName -ne 'DownloadOnly') { + Connect-SCCM -SiteCode $SiteCode -SiteServerFQDN $SiteServerFQDN + $ExistingPackage = Confirm-ExistingPackage -Package $DriverPackage -SiteCode $SiteCode + } + + if ($ExistingPackage) { + ' Latest driver already in configmgr.' | Log + return + } - if (-not (Confirm-ExistingPackage -Package $DriverPackage -SiteCode $SiteCode) -and $Driver) { + if ($PSCmdlet.ParameterSetName -ne 'DownloadOnly') { "`n Driver version not found in configmgr" | Log @@ -103,7 +119,17 @@ function Update-MicrosoftDriver { 'DistributionPointGroups' { Start-ContentDistribution -CMPackage $CMPackage -SiteCode $SiteCode -DistributionPointGroups $DistributionPointGroups } } - } else { - ' Latest driver already in confimgr.' | Log + } + + if ($PSCmdlet.ParameterSetName -eq 'DownloadOnly') { + if (-not (Test-Path $ContentShare)) { + New-Item -Path $ContentShare -ItemType Directory | Out-Null + } + + ' Downloading: {0}' -f $Driver.FileName | Log + $DriverFile = Get-RemoteFile -Url $Driver.Url -Destination $ContentShare + + ' Downloaded: {0}' -f $DriverFile.FullName | Log } + } \ No newline at end of file diff --git a/source/public/Update-Model.ps1 b/source/public/Update-Model.ps1 index 1e7e780..3c085e4 100644 --- a/source/public/Update-Model.ps1 +++ b/source/public/Update-Model.ps1 @@ -25,15 +25,23 @@ function Update-Model { [io.directoryInfo] $WorkingDir, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DownloadOnly')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] + [Alias('Destination')] [io.directoryInfo] $ContentShare, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [string] $SiteCode, - [Parameter(Mandatory)] + [Parameter(Mandatory, ParameterSetName = 'DistributionPointGroups')] + [Parameter(Mandatory, ParameterSetName = 'DistributionPoints')] + [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [string] $SiteServerFQDN, @@ -47,7 +55,11 @@ function Update-Model { [Parameter(Mandatory, ParameterSetName = 'PointAndGroup')] [ValidateNotNullOrEmpty()] [string[]] - $DistributionPointGroups + $DistributionPointGroups, + + [Parameter(Mandatory, ParameterSetName = 'DownloadOnly')] + [switch] + $DownloadOnly ) if (-not $WorkingDir) { @@ -61,16 +73,22 @@ function Update-Model { OSVersion = $OSVersion WorkingDir = $WorkingDir ContentShare = $ContentShare - SiteCode = $SiteCode - SiteServerFQDN = $SiteServerFQDN } $Bios = @{ Model = $Model WorkingDir = $WorkingDir ContentShare = $ContentShare - SiteCode = $SiteCode - SiteServerFQDN = $SiteServerFQDN + } + + if ($PSCmdlet.ParameterSetName -eq 'DownloadOnly') { + $Driver.Add('DownloadOnly', $true) + $Bios.Add('DownloadOnly', $true) + } else { + $Driver.Add('SiteCode', $SiteCode) + $Driver.Add('SiteServerFQDN', $SiteServerFQDN) + $Bios.Add('SiteCode', $SiteCode) + $Bios.Add('SiteServerFQDN', $SiteServerFQDN) } if ($DistributionPoints) {