Compare commits

..

5 Commits

Author SHA1 Message Date
rbalsleyMSFT 9d4b66851a Merge pull request #42 from rbalsleyMSFT/2407.2
Fixed Lenovo driver download issues
2024-07-23 12:41:32 -07:00
rbalsleyMSFT 3ba0da19f8 Fixed Lenovo driver download issues 2024-07-23 12:38:17 -07:00
rbalsleyMSFT 6826f854ae updated drivers info 2024-07-22 14:45:35 -07:00
rbalsleyMSFT afa524091c adding authentication info when downloading store apps via Winget 2024-07-22 14:42:41 -07:00
rbalsleyMSFT f14c7f2b00 Update README.md 2024-07-22 14:19:24 -07:00
3 changed files with 29 additions and 42 deletions
+3 -1
View File
@@ -16,7 +16,7 @@ To support the newly released Copilot+ PCs, we now support the creation and depl
* The host machine you're building the FFU from must be ARM64 * The host machine you're building the FFU from must be ARM64
* Office/M365 apps don't currently support installing the ARM64 native bits from an offline system. If you pass `-InstallOffice $true` the script will change the value to false. You can install office after the fact when connected to the internet. I'm investigating this behavior and will issue a fix if/when this gets resolved. I still don't recommend building the FFU VM on the internet. * Office/M365 apps don't currently support installing the ARM64 native bits from an offline system. If you pass `-InstallOffice $true` the script will change the value to false. You can install office after the fact when connected to the internet. I'm investigating this behavior and will issue a fix if/when this gets resolved. I still don't recommend building the FFU VM on the internet.
* The [Defender Updates Site](https://www.microsoft.com/en-us/wdsi/defenderupdates) provides download links for Defender definitions. The ARM link doesn't work for ARM64 and mpam-fe.exe fails to install. However there might be an undocumented ARM64 URL that may work. I've included it, but haven't tested it as I'm writing these notes. So we'll see if that works out. * The [Defender Updates Site](https://www.microsoft.com/en-us/wdsi/defenderupdates) provides download links for Defender definitions. The ARM link doesn't work for ARM64 and mpam-fe.exe fails to install. However there might be an undocumented ARM64 URL that may work. I've included it, but haven't tested it as I'm writing these notes. So we'll see if that works out.
* Drivers - I know Surface Laptop 7 and Pro * Drivers - Surface Laptop 7 and Pro 11 don't have ARM64 drivers available yet (there are entries, but they just point to a .txt file). Other OEMs may have drivers available.
In all, testing has gone very well. In all, testing has gone very well.
@@ -43,6 +43,8 @@ In order to get apps to help build your AppList.json file, just run `winget sear
In this example we see that Firefox is published to both the msstore and winget sources. It's up to you which one you'd like to pick (I assume the msstore and the 128 version from the winget source are both the same version, but that may not be the case). You'll want to use the Name, ID, and Source values to help create your AppList.json file. In this example we see that Firefox is published to both the msstore and winget sources. It's up to you which one you'd like to pick (I assume the msstore and the 128 version from the winget source are both the same version, but that may not be the case). You'll want to use the Name, ID, and Source values to help create your AppList.json file.
When downloading msstore apps, it does require an Entra ID. If you're building your FFUs from a machine that is not signed in with an Entra ID, you will be prompted for credentials for each app you download AND for the license file for each app (2 prompts per app). If downloading many store apps is something you plan on doing, I highly recommend signing in with an Entra ID to prevent the authentication prompts.
Other improvements Other improvements
* [mhaley](https://github.com/mhaley) made their first contribution to [assign the drive letter to the recovery partition when copying in a custom WinRE.wim](https://github.com/rbalsleyMSFT/FFU/pull/35) * [mhaley](https://github.com/mhaley) made their first contribution to [assign the drive letter to the recovery partition when copying in a custom WinRE.wim](https://github.com/rbalsleyMSFT/FFU/pull/35)
+12 -27
View File
@@ -903,42 +903,28 @@ function Get-LenovoDrivers {
[int]$WindowsRelease [int]$WindowsRelease
) )
# Parse the Lenovo PSREF search page for machine types
function Get-LenovoPSREF { function Get-LenovoPSREF {
param ( param (
[string]$ModelName [string]$ModelName
) )
$url = "https://psref.lenovo.com/search" $url = "https://psref.lenovo.com/api/search/DefinitionFilterAndSearch/Suggest?kw=$ModelName"
WriteLog "Getting Lenovo PSREF page for model: $ModelName" WriteLog "Querying Lenovo PSREF API for model: $ModelName"
$OriginalVerbosePreference = $VerbosePreference $OriginalVerbosePreference = $VerbosePreference
$VerbosePreference = 'SilentlyContinue' $VerbosePreference = 'SilentlyContinue'
$webContent = Invoke-WebRequest -Uri $url $response = Invoke-WebRequest -Uri $url -UseBasicParsing -Headers $Headers -UserAgent $UserAgent
$VerbosePreference = $OriginalVerbosePreference $VerbosePreference = $OriginalVerbosePreference
WriteLog "Complete" WriteLog "Complete"
# Access the parsed HTML $jsonResponse = $response.Content | ConvertFrom-Json
WriteLog "Parsing content"
$parsedHtml = $webContent.ParsedHtml
# Select the nodes you are interested in
$productNameNodes = $parsedHtml.getElementsByTagName("li") | Where-Object { $_.className -contains "productname_li" }
$products = @() $products = @()
# Iterate through the nodes foreach ($item in $jsonResponse.data) {
foreach ($product in $productNameNodes) { $productName = $item.ProductName
$productA = $product.getElementsByTagName("a") | Where-Object { $_.tagName -eq "a" } $machineTypes = $item.MachineType -split " / "
$innertext = @($productA.innertext) # Ensure innertext is treated as an array
$productName = $innertext[0]
#if $productname contains 'Chromebook', skip the product
if ($productName -like '*Chromebook*') {
continue
}
$machineTypes = $innertext[1..($innertext.Count - 1)]
if ($innertext -match $ModelName) {
foreach ($machineType in $machineTypes) { foreach ($machineType in $machineTypes) {
If ($machineType -eq $modelName) { if ($machineType -eq $ModelName) {
WriteLog "Model name entered is a matching machine type" WriteLog "Model name entered is a matching machine type"
$products = @() $products = @()
$products += [pscustomobject]@{ $products += [pscustomobject]@{
@@ -946,7 +932,7 @@ function Get-LenovoDrivers {
MachineType = $machineType MachineType = $machineType
} }
WriteLog "Product Name: $productName Machine Type: $machineType" WriteLog "Product Name: $productName Machine Type: $machineType"
continue return $products
} }
$products += [pscustomobject]@{ $products += [pscustomobject]@{
ProductName = $productName ProductName = $productName
@@ -954,18 +940,17 @@ function Get-LenovoDrivers {
} }
} }
} }
}
return ,$products return ,$products
} }
# Parse the Lenovo PSREF page for the model # Parse the Lenovo PSREF page for the model
$machineTypes = Get-LenovoPSREF -ModelName $Model $machineTypes = Get-LenovoPSREF -ModelName $Model
if ($machineTypes.Count -eq 0) { if ($machineTypes.ProductName.Count -eq 0) {
WriteLog "No machine types found for model: $Model" WriteLog "No machine types found for model: $Model"
WriteLog "Enter a valid model or machine type in the -model parameter" WriteLog "Enter a valid model or machine type in the -model parameter"
exit exit
} elseif ($machineTypes.Count -eq 1) { } elseif ($machineTypes.ProductName.Count -eq 1) {
$machineType = $machineTypes[0].MachineType $machineType = $machineTypes[0].MachineType
$model = $machineTypes[0].ProductName $model = $machineTypes[0].ProductName
} else { } else {
@@ -973,7 +958,7 @@ function Get-LenovoDrivers {
Write-Output "Multiple machine types found for model: $Model" Write-Output "Multiple machine types found for model: $Model"
} }
WriteLog "Multiple machine types found for model: $Model" WriteLog "Multiple machine types found for model: $Model"
for ($i = 0; $i -lt $machineTypes.Count; $i++) { for ($i = 0; $i -lt $machineTypes.ProductName.Count; $i++) {
if ($VerbosePreference -ne 'Continue'){ if ($VerbosePreference -ne 'Continue'){
Write-Output "$($i + 1). $($machineTypes[$i].ProductName) ($($machineTypes[$i].MachineType))" Write-Output "$($i + 1). $($machineTypes[$i].ProductName) ($($machineTypes[$i].MachineType))"
} }
+1 -1
View File
@@ -8,7 +8,7 @@ While we use this in Education at Microsoft, other industries can use it as well
# Updates # Updates
2406.1 has been released! Check out the changes in the new [Change Log](ChangeLog.md) 2407.1 has been released! Check out the changes in the new [Change Log](ChangeLog.md)
# Getting Started # Getting Started