forked from DeploymentResearch/DRFiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install-HYDWindowsADK10v1809.ps1
55 lines (43 loc) · 2.46 KB
/
Install-HYDWindowsADK10v1809.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
<#
************************************************************************************************************************
Created: October 2, 2018
Version: 1.0
Disclaimer:
This script is provided "AS IS" with no warranties, confers no rights and
is not supported by the author or DeploymentArtist.
Author - Johan Arwidmark
Twitter: @jarwidmark
Blog : http://deploymentresearch.com
************************************************************************************************************************
#>
# Check for elevation
Write-Host "Checking for elevation"
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Warning "Oupps, you need to run this script from an elevated PowerShell prompt!`nPlease start the PowerShell prompt as an Administrator and re-run the script."
Write-Warning "Aborting script..."
Break
}
# Change these to match location of downloaded files
$ADKSetupFile = "C:\Setup\Windows ADK 10 v1809\adksetup.exe"
$WinPEAddonSetupFile = "C:\Setup\WinPE Addon for Windows ADK 10 v1809\adkwinpesetup.exe"
# Validation
if (!(Test-Path -path $ADKSetupFile)) {Write-Warning "Could not find Windows 10 ADK Setup files, aborting...";Break}
if (!(Test-Path -path $WinPEAddonSetupFile)) {Write-Warning "Could not find WinPE Addon Setup files, aborting...";Break}
# Install Windows ADK 10 with components for MDT and/or ConfigMgr
# For troubleshooting, check logs in %temp%\adk
$SetupName = "Windows ADK 10"
$SetupSwitches = "/Features OptionId.DeploymentTools OptionId.ImagingAndConfigurationDesigner OptionId.ICDConfigurationDesigner OptionId.UserStateMigrationTool /norestart /quiet /ceip off"
Write-Output "Starting install of $SetupName"
Write-Output "Command line to start is: $ADKSetupFile $SetupSwitches"
Start-Process -FilePath $ADKSetupFile -ArgumentList $SetupSwitches -NoNewWindow -Wait
Write-Output "Finished installing $SetupName"
# Install WinPE Addon for Windows ADK 10
# For troubleshooting, check logs in %temp%\adk
$SetupName = "WinPE Addon for Windows ADK 10"
$SetupSwitches = "/Features OptionId.WindowsPreinstallationEnvironment /norestart /quiet /ceip off"
Write-Output "Starting install of $SetupName"
Write-Output "Command line to start is: $WinPEAddonSetupFile $SetupSwitches"
Start-Process -FilePath $WinPEAddonSetupFile -ArgumentList $SetupSwitches -NoNewWindow -Wait
Write-Output "Finished installing $SetupName"