-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathUpdate-All.ps1
88 lines (69 loc) · 2.16 KB
/
Update-All.ps1
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
. '.\inc\Config.ps1'
. '.\inc\Params.ps1'
. '.\inc\Functions.ps1'
# Main Program
# Add Drivers
if ($os -like "windows-pe-*")
{
# If working on 1-imaged boot.wim (winpe)
MountWim $wim_file $mount_dir $wim_image_name
AddDrivers $drivers_dir $mount_dir
AddUpdates $update_dir $mount_dir
AddTools $tools_dir $mount_dir
SafeUnmountWim $mount_dir
}
else
{
if ($boot) {
# If working on 2-imaged boot.wim
Write-Host "This will update both images, including boot and install. It will atempt to go through the following:"
while("y","n" -notcontains $answer)
{
$answer = Read-Host "AddDrivers, Add Updates, AddTools.`nContinue? (y/n)"
}
if ($answer -eq "n")
{
Write-Host "Cancelled."
exit 1
}
Write-Host "Working on the boot image" -foregroundcolor "green"
#$boot = $true
#. '.\inc\Params.ps1'
#. '.\inc\Functions.ps1'
MountWim $wim_file $mount_dir $wim_image_name_pe
AddDrivers $drivers_dir $mount_dir
SafeUnmountWim $mount_dir
MountWim $wim_file $mount_dir $wim_image_name_setup
AddDrivers $drivers_dir $mount_dir
AddTools $tools_dir $mount_dir
# This will add additional PE packages
AddUpdates $updates_dir $mount_dir
SafeUnmountWim $mount_dir
#Write-Host "Working on the install image" -foregroundcolor "green"
#$boot = $false
#. '.\inc\Params.ps1'
#. '.\inc\Functions.ps1'
#MountWim $wim_file $mount_dir $wim_image_name
#AddDrivers $drivers_dir $mount_dir
#AddUpdates $update_dir $mount_dir
#AddTools $tools_dir $mount_dir
# No Unmount intentionally here
} else {
Write-Host "This will update the image. We will attempt to go through the following:"
while("y","n" -notcontains $answer)
{
$answer = Read-Host "AddTools, AddUpdates. `nContinue? (y/n)"
}
if ($answer -eq "n")
{
Write-Host "Cancelled."
exit 1
}
MountWim $wim_file $mount_dir $wim_image_name
AddTools $tools_dir $mount_dir $wim_image_name
Write-Host "Not adding any drivers. They should be injected into boot.wim as well as accessible via CIFS at \\wimagingHost\\install\drivers"
#AddDrivers $drivers_dir $mount_dir
AddUpdates $updates_dir $mount_dir
SafeUnmountWim $mount_dir
}
}