# tpmupgrade.osdcloud.ch $Global:Transcript = "$((Get-Date).ToString('yyyy-MM-dd-HHmmss'))-TPMUpgrade_HP_AllInOne.log" Start-Transcript -Path (Join-Path "$env:ProgramData\Microsoft\IntuneManagementExtension\Logs\OSD\" $Global:Transcript) -ErrorAction Ignore # Get OSD module $Module = Import-Module OSD -PassThru -ErrorAction Ignore if (-not $Module) { Write-Host "`n=========================================`n" Write-Host "Installing module OSD" Install-Module OSD -Force } Import-Module OSD -Scope Global -Force $Model = Get-MyComputerModel if ($Model -notlike "*HP EliteOne 800 G2 23-in Touch*" -or $Model -notlike "*HP EliteOne 800 G3 23.8-in Touch*") { Write-Host "This TPM firmware doens't support your model" Write-Host "`n=========================================`n" Stop-Transcript #Exit 1 } [System.String]$DownloadPath = 'C:\Drivers' if (-NOT (Test-Path "$DownloadPath")) { New-Item $DownloadPath -ItemType Directory -Force -ErrorAction Stop | Out-Null } $FileName = 'HP_TPM_Upgrade.exe' $OutFile = Join-Path $DownloadPath $FileName $SourceURL = "https://ftp.hp.com/pub/softpaq/sp87501-88000/sp87753.exe" Write-Host "`n=========================================`n" Write-Host "Downloading SoftPack file" Save-WebFile -SourceUrl $SourceURL -DestinationDirectory $DownloadPath -DestinationName $FileName if (! (Test-Path $OutFile)) { Write-Warning "$((Get-Date).ToString('yyyy-MM-dd-HHmmss')) SoftPack failed to download" Write-Host "`n=========================================`n" Stop-Transcript #Exit 1 } Write-Host "`n=========================================`n" Write-Host "Extracting SoftPack file" Start-Process -FilePath $OutFile -ArgumentList "/s /f $DownloadPath" Write-Host "`n=========================================`n" Write-Host "Executing SoftPack file" Start-Process -FilePath "$DownloadPath\TPMConfig64.exe" -ArgumentList "-s" Write-Host "`n=========================================`n" Write-Host "Rebooting the host in 10 seconds" Start-Process "C:\Windows\System32\shutdown.exe" -ArgumentList "-r -t 10" Stop-Transcript