-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathInstallESUIntermediateCert.ps1
More file actions
30 lines (24 loc) · 998 Bytes
/
Copy pathInstallESUIntermediateCert.ps1
File metadata and controls
30 lines (24 loc) · 998 Bytes
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
function Install-ESUIntermediateCert
{
[CmdletBinding()]
param ()
# run this script on elevated powershell.exe
$esuTempFolder = "$env:windir\esuTemp"
$esutempDirectoryExisted = $false
if( -not (Test-Path $esuTempFolder)) {
New-Item -Path $esuTempFolder -ItemType Directory -Force
$esutempDirectoryExisted = $true
}
Push-Location $esuTempFolder
Invoke-WebRequest -Uri "https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2001%20-%20xsign.crt" -OutFile ./matlsissuingca01.crt
certutil -addstore CA ./matlsissuingca01.crt
Pop-Location
#Remove the temp directory
if( -not $esutempDirectoryExisted){
Remove-Item -Recurse -Path $esuTempFolder -force -verbose
}
Write-Verbose "Please reboot the machine if machine needs a reboot before installing the updates."
}
Install-ESUIntermediateCert -verBose
##Reboot the machine if machine needs a reboot before installing the updates.