-
Notifications
You must be signed in to change notification settings - Fork 0
/
win11test
95 lines (77 loc) · 3.49 KB
/
win11test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#to Run, boot OSDCloudUSB, at the PS Prompt: iex (irm win11.garytown.com)
$ScriptName = 'win11.garytown.com'
$ScriptVersion = '24.01.01.03'
Write-Host -ForegroundColor Green "$ScriptName $ScriptVersion"
#iex (irm oobetasks.osdcloud.ch) #Add custom functions used in Script Hosting in GitHub
#iex (irm functions.osdcloud.com) #Add custom fucntions from OSDCloud
<# Offline Driver Details
If you extract Driver Packs to your Flash Drive, you can DISM them in while in WinPE and it will make the process much faster, plus ensure driver support for first Boot
Extract to: OSDCLoudUSB:\OSDCloud\DriverPacks\DISM\$ComputerManufacturer\$ComputerProduct
Use OSD Module to determine Vars
$ComputerProduct = (Get-MyComputerProduct)
$ComputerManufacturer = (Get-MyComputerManufacturer -Brief)
#>
#Variables to define the Windows OS / Edition etc to be applied during OSDCloud
$OSVersion = 'Windows 11' #Used to Determine Driver Pack
$OSReleaseID = '23H2' #Used to Determine Driver Pack
$OSName = 'Windows 11 23H2 x64'
$OSEdition = 'Pro'
$OSActivation = 'Retail'
$OSLanguage = 'en-us'
#Set OSDCloud Vars
$Global:MyOSDCloud = [ordered]@{
Restart = [bool]$true
RecoveryPartition = [bool]$true
OEMActivation = [bool]$True
WindowsUpdate = [bool]$true
WindowsUpdateDrivers = [bool]$true
WindowsDefenderUpdate = [bool]$false
SetTimeZone = [bool]$true
ClearDiskConfirm = [bool]$False
ShutdownSetupComplete = [bool]$true
SyncMSUpCatDriverUSB = [bool]$true
Bitlocker = [bool]$true
}
#Testing MS Update Catalog Driver Sync
#$Global:MyOSDCloud.DriverPackName = 'Microsoft Update Catalog'
#Used to Determine Driver Pack
$Product = (Get-MyComputerProduct)
$DriverPack = Get-OSDCloudDriverPack -Product $Product -OSVersion $OSVersion -OSReleaseID $OSReleaseID
if ($DriverPack){
$Global:MyOSDCloud.DriverPackName = $DriverPack.Name
}
#If Drivers are expanded on the USB Drive, disable installing a Driver Pack
if (Test-DISMFromOSDCloudUSB -eq $true){
Write-Host "Found Driver Pack Extracted on Cloud USB Flash Drive, disabling Driver Download via OSDCloud" -ForegroundColor Green
if ($Global:MyOSDCloud.SyncMSUpCatDriverUSB -eq $true){
write-host "Setting DriverPackName to 'Microsoft Update Catalog'"
$Global:MyOSDCloud.DriverPackName = 'Microsoft Update Catalog'
}
else {
write-host "Setting DriverPackName to 'None'"
$Global:MyOSDCloud.DriverPackName = "None"
}
}
#>
#Enable HPIA | Update HP BIOS | Update HP TPM
if (Test-HPIASupport){
#$Global:MyOSDCloud.DevMode = [bool]$True
$Global:MyOSDCloud.HPTPMUpdate = [bool]$True
$Global:MyOSDCloud.HPIAALL = [bool]$true
$Global:MyOSDCloud.HPBIOSUpdate = [bool]$true
}
#write variables to console
$Global:MyOSDCloud
#Update Files in Module that have been updated since last PowerShell Gallery Build (Testing Only)
$ModulePath = (Get-ChildItem -Path "$($Env:ProgramFiles)\WindowsPowerShell\Modules\osd" | Where-Object {$_.Attributes -match "Directory"} | select -Last 1).fullname
import-module "$ModulePath\OSD.psd1" -Force
#Launch OSDCloud
Write-Host "Starting OSDCloud" -ForegroundColor Green
write-host "Start-OSDCloud -OSName $OSName -OSEdition $OSEdition -OSActivation $OSActivation -OSLanguage $OSLanguage"
Start-OSDCloud -OSName $OSName -OSEdition $OSEdition -OSActivation $OSActivation -OSLanguage $OSLanguage
write-host "OSDCloud Process Complete, Running Custom Actions From Script Before Reboot" -ForegroundColor Green
if (Test-DISMFromOSDCloudUSB){
Start-DISMFromOSDCloudUSB
}
#Restart
restart-computer