From 5dcdd2c36f5a3a15d1a9bb160dd8f638eed7376b Mon Sep 17 00:00:00 2001
From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com>
Date: Tue, 17 Sep 2024 14:03:43 -0700
Subject: [PATCH] Clean up the Get-MicrosoftDrivers old code and version change
---
FFUDevelopment/BuildFFUVM.ps1 | 159 +---------------------------------
1 file changed, 1 insertion(+), 158 deletions(-)
diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1
index 7829a3f..d09359b 100644
--- a/FFUDevelopment/BuildFFUVM.ps1
+++ b/FFUDevelopment/BuildFFUVM.ps1
@@ -336,7 +336,7 @@ param(
[bool]$AllowExternalHardDiskMedia,
[bool]$PromptExternalHardDiskMedia = $true
)
-$version = '2409.2'
+$version = '2410.1'
#Check if Hyper-V feature is installed (requires only checks the module)
$osInfo = Get-WmiObject -Class Win32_OperatingSystem
@@ -541,163 +541,6 @@ function Start-BitsTransferWithRetry {
return $false
}
-# function Get-MicrosoftDrivers {
-# param (
-# [string]$Make,
-# [string]$Model,
-# [int]$WindowsRelease
-# )
-
-# $url = "https://support.microsoft.com/en-us/surface/download-drivers-and-firmware-for-surface-09bb2e09-2a4b-cb69-0951-078a7739e120"
-
-# # Download the webpage content
-# WriteLog "Getting Surface driver information from $url"
-# $OriginalVerbosePreference = $VerbosePreference
-# $VerbosePreference = 'SilentlyContinue'
-# $webContent = Invoke-WebRequest -Uri $url -UseBasicParsing -Headers $Headers -UserAgent $UserAgent
-# $VerbosePreference = $OriginalVerbosePreference
-# WriteLog "Complete"
-
-# # Parse the content of the relevant nested divs
-# WriteLog "Parsing web content for models and download links"
-# $html = $webContent.Content
-# $nestedDivPattern = '
(.*?)
'
-# $nestedDivMatches = [regex]::Matches($html, $nestedDivPattern, [System.Text.RegularExpressions.RegexOptions]::Singleline)
-
-# $models = @()
-# $modelPattern = '(.*?)
\s*\s*\s* \s*window.__DLCDetails__={(.*?)}'
-# $scriptMatch = [regex]::Match($downloadPageContent.Content, $scriptPattern)
-
-# if ($scriptMatch.Success) {
-# $scriptContent = $scriptMatch.Groups[1].Value
-
-# # Extract the download file information from the script tag
-# $downloadFilePattern = '"name":"(.*?)",.*?"url":"(.*?)"'
-# $downloadFileMatches = [regex]::Matches($scriptContent, $downloadFilePattern)
-
-# $downloadLink = $null
-# foreach ($downloadFile in $downloadFileMatches) {
-# $fileName = $downloadFile.Groups[1].Value
-# $fileUrl = $downloadFile.Groups[2].Value
-
-# if ($fileName -match "Win$WindowsRelease") {
-# $downloadLink = $fileUrl
-# break
-# }
-# }
-
-# if ($downloadLink) {
-# WriteLog "Download Link for Windows ${WindowsRelease}: $downloadLink"
-
-# # Create directory structure
-# if (-not (Test-Path -Path $DriversFolder)) {
-# WriteLog "Creating Drivers folder: $DriversFolder"
-# New-Item -Path $DriversFolder -ItemType Directory -Force | Out-Null
-# WriteLog "Drivers folder created"
-# }
-# $surfaceDriversPath = Join-Path -Path $DriversFolder -ChildPath $Make
-# $modelPath = Join-Path -Path $surfaceDriversPath -ChildPath $Model
-# if (-Not (Test-Path -Path $modelPath)) {
-# WriteLog "Creating model folder: $modelPath"
-# New-Item -Path $modelPath -ItemType Directory | Out-Null
-# WriteLog "Complete"
-# }
-
-# # Download the file
-# $filePath = Join-Path -Path $surfaceDriversPath -ChildPath ($fileName)
-# WriteLog "Downloading $Model driver file to $filePath"
-# Start-BitsTransferWithRetry -Source $downloadLink -Destination $filePath
-# WriteLog "Download complete"
-
-# # Determine file extension
-# $fileExtension = [System.IO.Path]::GetExtension($filePath).ToLower()
-
-# if ($fileExtension -eq ".msi") {
-# # Extract the MSI file using an administrative install
-# WriteLog "Extracting MSI file to $modelPath"
-# $arguments = "/a `"$($filePath)`" /qn TARGETDIR=`"$($modelPath)`""
-# Invoke-Process -FilePath "msiexec.exe" -ArgumentList $arguments
-# WriteLog "Extraction complete"
-# } elseif ($fileExtension -eq ".zip") {
-# # Extract the ZIP file
-# WriteLog "Extracting ZIP file to $modelPath"
-# $ProgressPreference = 'SilentlyContinue'
-# Expand-Archive -Path $filePath -DestinationPath $modelPath -Force
-# $ProgressPreference = 'Continue'
-# WriteLog "Extraction complete"
-# } else {
-# WriteLog "Unsupported file type: $fileExtension"
-# }
-# # Remove the downloaded file
-# WriteLog "Removing $filePath"
-# Remove-Item -Path $filePath -Force
-# WriteLog "Complete"
-# } else {
-# WriteLog "No download link found for Windows $WindowsRelease."
-# }
-# } else {
-# WriteLog "Failed to parse the download page for the MSI file."
-# }
-# }
function Get-MicrosoftDrivers {
param (
[string]$Make,
|