From d9f8b4053571ec94cafd64d9ae2764d4a2354ac4 Mon Sep 17 00:00:00 2001 From: fullon2 Date: Mon, 26 Oct 2020 14:15:52 +0100 Subject: [PATCH 1/5] Remove empty object from input data in Confirm-SystemSKU. Resolve "multiple packages have been matched" error. --- Invoke-CMApplyDriverPackage.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Invoke-CMApplyDriverPackage.ps1 b/Invoke-CMApplyDriverPackage.ps1 index 9ecbc52..230ff77 100644 --- a/Invoke-CMApplyDriverPackage.ps1 +++ b/Invoke-CMApplyDriverPackage.ps1 @@ -190,7 +190,8 @@ - Added support for decompressing WIM driver packages. 4.0.5 - (2020-09-16) - Fixed an issue for driver package compressed WIM support where it could not mount the file as the location was not empty, thanks to @SuneThomsenDK for reporting this. 4.0.6 - (2020-10-11) - Improved the AdminServiceEndpointType detection logic to mainly use the 'InInternet' property from ClientInfo WMI class together with if any detected type of active MP candidate was detected. -#> + 4.0.6a- (2020-10-20) - Remove Empty objects from input data in Confirm-SystemSKU + #> [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = "Execute")] param ( [parameter(Mandatory = $true, ParameterSetName = "BareMetal", HelpMessage = "Set the script to operate in 'BareMetal' deployment type mode.")] @@ -1645,7 +1646,7 @@ Process { } # Remove any space characters from driver package input data, replace them with a comma instead and ensure there's no duplicate entries - $DriverPackageInputArray = $DriverPackageInput.Replace(" ", ",").Split($SystemSKUDelimiter) | Select-Object -Unique + $DriverPackageInputArray = $DriverPackageInput.Replace(" ", ",").Split($SystemSKUDelimiter) | Where-object { -not [string]::IsNullOrWhiteSpace($_) }| Select-Object -Unique # Construct custom object for return value $SystemSKUDetectionResult = [PSCustomObject]@{ From ac5562cc554e31a0eec724902d9bf14c28c85b88 Mon Sep 17 00:00:00 2001 From: fullon2 Date: Mon, 26 Oct 2020 14:25:23 +0100 Subject: [PATCH 2/5] Add support for Intel, Unknown and Other models --- Invoke-CMApplyDriverPackage.ps1 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Invoke-CMApplyDriverPackage.ps1 b/Invoke-CMApplyDriverPackage.ps1 index 230ff77..ff8da6a 100644 --- a/Invoke-CMApplyDriverPackage.ps1 +++ b/Invoke-CMApplyDriverPackage.ps1 @@ -191,6 +191,7 @@ 4.0.5 - (2020-09-16) - Fixed an issue for driver package compressed WIM support where it could not mount the file as the location was not empty, thanks to @SuneThomsenDK for reporting this. 4.0.6 - (2020-10-11) - Improved the AdminServiceEndpointType detection logic to mainly use the 'InInternet' property from ClientInfo WMI class together with if any detected type of active MP candidate was detected. 4.0.6a- (2020-10-20) - Remove Empty objects from input data in Confirm-SystemSKU + 4.0.6b- (2020-10-20) - Add support for Intel, Unknown and Other models #> [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = "Execute")] param ( @@ -292,7 +293,7 @@ param ( [parameter(Mandatory = $false, ParameterSetName = "Debug", HelpMessage = "Override the automatically detected computer manufacturer when running in debug mode.")] [ValidateNotNullOrEmpty()] - [ValidateSet("Hewlett-Packard", "HP", "Dell", "Lenovo", "Microsoft", "Fujitsu", "Panasonic", "Viglen", "AZW")] + [ValidateSet("Hewlett-Packard", "HP", "Dell", "Lenovo", "Microsoft", "Fujitsu", "Panasonic", "Viglen", "AZW", "Intel")] [string]$Manufacturer, [parameter(Mandatory = $false, ParameterSetName = "Debug", HelpMessage = "Override the automatically detected computer model when running in debug mode.")] @@ -1118,6 +1119,23 @@ Process { $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() $ComputerDetails.SystemSKU = (Get-WmiObject -Class "Win32_BaseBoard" | Select-Object -ExpandProperty SKU).Trim() } + "*Intel*" { + $ComputerDetails.Manufacturer = "Intel" + $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() + $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() + } + "" { + $ComputerDetails.Manufacturer = "Intel" + $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() + If ($ComputerDetails.Model -eq "") {$ComputerDetails.Model = "UnknownModel"} + $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() + If ($ComputerDetails.SystemSKU -eq "") {$ComputerDetails.Model = "UnknownSKU"} + } + Default { + $ComputerDetails.Manufacturer = $ComputerManufacturer + $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() + $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() + } } # Handle overriding computer details if debug mode and additional parameters was specified From 0f5bf471ec1ed94aed77d3ef4243e2659877e69b Mon Sep 17 00:00:00 2001 From: fullon2 Date: Mon, 26 Oct 2020 14:46:21 +0100 Subject: [PATCH 3/5] Revert "Add support for Intel, Unknown and Other models" This reverts commit ac5562cc554e31a0eec724902d9bf14c28c85b88. --- Invoke-CMApplyDriverPackage.ps1 | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Invoke-CMApplyDriverPackage.ps1 b/Invoke-CMApplyDriverPackage.ps1 index ff8da6a..230ff77 100644 --- a/Invoke-CMApplyDriverPackage.ps1 +++ b/Invoke-CMApplyDriverPackage.ps1 @@ -191,7 +191,6 @@ 4.0.5 - (2020-09-16) - Fixed an issue for driver package compressed WIM support where it could not mount the file as the location was not empty, thanks to @SuneThomsenDK for reporting this. 4.0.6 - (2020-10-11) - Improved the AdminServiceEndpointType detection logic to mainly use the 'InInternet' property from ClientInfo WMI class together with if any detected type of active MP candidate was detected. 4.0.6a- (2020-10-20) - Remove Empty objects from input data in Confirm-SystemSKU - 4.0.6b- (2020-10-20) - Add support for Intel, Unknown and Other models #> [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = "Execute")] param ( @@ -293,7 +292,7 @@ param ( [parameter(Mandatory = $false, ParameterSetName = "Debug", HelpMessage = "Override the automatically detected computer manufacturer when running in debug mode.")] [ValidateNotNullOrEmpty()] - [ValidateSet("Hewlett-Packard", "HP", "Dell", "Lenovo", "Microsoft", "Fujitsu", "Panasonic", "Viglen", "AZW", "Intel")] + [ValidateSet("Hewlett-Packard", "HP", "Dell", "Lenovo", "Microsoft", "Fujitsu", "Panasonic", "Viglen", "AZW")] [string]$Manufacturer, [parameter(Mandatory = $false, ParameterSetName = "Debug", HelpMessage = "Override the automatically detected computer model when running in debug mode.")] @@ -1119,23 +1118,6 @@ Process { $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() $ComputerDetails.SystemSKU = (Get-WmiObject -Class "Win32_BaseBoard" | Select-Object -ExpandProperty SKU).Trim() } - "*Intel*" { - $ComputerDetails.Manufacturer = "Intel" - $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() - $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() - } - "" { - $ComputerDetails.Manufacturer = "Intel" - $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() - If ($ComputerDetails.Model -eq "") {$ComputerDetails.Model = "UnknownModel"} - $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() - If ($ComputerDetails.SystemSKU -eq "") {$ComputerDetails.Model = "UnknownSKU"} - } - Default { - $ComputerDetails.Manufacturer = $ComputerManufacturer - $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() - $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() - } } # Handle overriding computer details if debug mode and additional parameters was specified From 4acefbeb09cd7f7b4396a7a49eeedfd411a83d53 Mon Sep 17 00:00:00 2001 From: fullon2 Date: Mon, 26 Oct 2020 14:52:18 +0100 Subject: [PATCH 4/5] Revert "Revert "Add support for Intel, Unknown and Other models"" This reverts commit 0f5bf471ec1ed94aed77d3ef4243e2659877e69b. --- Invoke-CMApplyDriverPackage.ps1 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Invoke-CMApplyDriverPackage.ps1 b/Invoke-CMApplyDriverPackage.ps1 index 230ff77..ff8da6a 100644 --- a/Invoke-CMApplyDriverPackage.ps1 +++ b/Invoke-CMApplyDriverPackage.ps1 @@ -191,6 +191,7 @@ 4.0.5 - (2020-09-16) - Fixed an issue for driver package compressed WIM support where it could not mount the file as the location was not empty, thanks to @SuneThomsenDK for reporting this. 4.0.6 - (2020-10-11) - Improved the AdminServiceEndpointType detection logic to mainly use the 'InInternet' property from ClientInfo WMI class together with if any detected type of active MP candidate was detected. 4.0.6a- (2020-10-20) - Remove Empty objects from input data in Confirm-SystemSKU + 4.0.6b- (2020-10-20) - Add support for Intel, Unknown and Other models #> [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = "Execute")] param ( @@ -292,7 +293,7 @@ param ( [parameter(Mandatory = $false, ParameterSetName = "Debug", HelpMessage = "Override the automatically detected computer manufacturer when running in debug mode.")] [ValidateNotNullOrEmpty()] - [ValidateSet("Hewlett-Packard", "HP", "Dell", "Lenovo", "Microsoft", "Fujitsu", "Panasonic", "Viglen", "AZW")] + [ValidateSet("Hewlett-Packard", "HP", "Dell", "Lenovo", "Microsoft", "Fujitsu", "Panasonic", "Viglen", "AZW", "Intel")] [string]$Manufacturer, [parameter(Mandatory = $false, ParameterSetName = "Debug", HelpMessage = "Override the automatically detected computer model when running in debug mode.")] @@ -1118,6 +1119,23 @@ Process { $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() $ComputerDetails.SystemSKU = (Get-WmiObject -Class "Win32_BaseBoard" | Select-Object -ExpandProperty SKU).Trim() } + "*Intel*" { + $ComputerDetails.Manufacturer = "Intel" + $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() + $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() + } + "" { + $ComputerDetails.Manufacturer = "Intel" + $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() + If ($ComputerDetails.Model -eq "") {$ComputerDetails.Model = "UnknownModel"} + $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() + If ($ComputerDetails.SystemSKU -eq "") {$ComputerDetails.Model = "UnknownSKU"} + } + Default { + $ComputerDetails.Manufacturer = $ComputerManufacturer + $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() + $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() + } } # Handle overriding computer details if debug mode and additional parameters was specified From 33749dadd431740a1a5e357a253067d7d44a9b14 Mon Sep 17 00:00:00 2001 From: fullon2 Date: Mon, 26 Oct 2020 15:00:43 +0100 Subject: [PATCH 5/5] Revert "Add support for Intel, Unknown and Other models" This reverts commit ac5562cc554e31a0eec724902d9bf14c28c85b88. --- Invoke-CMApplyDriverPackage.ps1 | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Invoke-CMApplyDriverPackage.ps1 b/Invoke-CMApplyDriverPackage.ps1 index ff8da6a..230ff77 100644 --- a/Invoke-CMApplyDriverPackage.ps1 +++ b/Invoke-CMApplyDriverPackage.ps1 @@ -191,7 +191,6 @@ 4.0.5 - (2020-09-16) - Fixed an issue for driver package compressed WIM support where it could not mount the file as the location was not empty, thanks to @SuneThomsenDK for reporting this. 4.0.6 - (2020-10-11) - Improved the AdminServiceEndpointType detection logic to mainly use the 'InInternet' property from ClientInfo WMI class together with if any detected type of active MP candidate was detected. 4.0.6a- (2020-10-20) - Remove Empty objects from input data in Confirm-SystemSKU - 4.0.6b- (2020-10-20) - Add support for Intel, Unknown and Other models #> [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = "Execute")] param ( @@ -293,7 +292,7 @@ param ( [parameter(Mandatory = $false, ParameterSetName = "Debug", HelpMessage = "Override the automatically detected computer manufacturer when running in debug mode.")] [ValidateNotNullOrEmpty()] - [ValidateSet("Hewlett-Packard", "HP", "Dell", "Lenovo", "Microsoft", "Fujitsu", "Panasonic", "Viglen", "AZW", "Intel")] + [ValidateSet("Hewlett-Packard", "HP", "Dell", "Lenovo", "Microsoft", "Fujitsu", "Panasonic", "Viglen", "AZW")] [string]$Manufacturer, [parameter(Mandatory = $false, ParameterSetName = "Debug", HelpMessage = "Override the automatically detected computer model when running in debug mode.")] @@ -1119,23 +1118,6 @@ Process { $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() $ComputerDetails.SystemSKU = (Get-WmiObject -Class "Win32_BaseBoard" | Select-Object -ExpandProperty SKU).Trim() } - "*Intel*" { - $ComputerDetails.Manufacturer = "Intel" - $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() - $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() - } - "" { - $ComputerDetails.Manufacturer = "Intel" - $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() - If ($ComputerDetails.Model -eq "") {$ComputerDetails.Model = "UnknownModel"} - $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() - If ($ComputerDetails.SystemSKU -eq "") {$ComputerDetails.Model = "UnknownSKU"} - } - Default { - $ComputerDetails.Manufacturer = $ComputerManufacturer - $ComputerDetails.Model = (Get-WmiObject -Class "Win32_ComputerSystem" | Select-Object -ExpandProperty Model).Trim() - $ComputerDetails.SystemSKU = (Get-CIMInstance -ClassName "MS_SystemInformation" -NameSpace root\WMI).BaseBoardProduct.Trim() - } } # Handle overriding computer details if debug mode and additional parameters was specified