-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sos-install-java-config.ps1
32 lines (28 loc) · 1.61 KB
/
sos-install-java-config.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
#https://gist.github.com/MyITGuy/9628895
#http://stu.cbu.edu/java/docs/technotes/guides/deploy/properties.html
#https://github.com/simeononsecurity/JAVA-STIG-Script
#<Windows Directory>\Sun\Java\Deployment\deployment.config
#- or -
#<JRE Installation Directory>\lib\deployment.config
#Require elivation for script run
Write-Output "Elevating priviledges for this process"
do {} until (Elevate-Privileges SeTakeOwnershipPrivilege)
#Set Directory to PSScriptRoot
if ((Get-Location).Path -NE $PSScriptRoot) { Set-Location $PSScriptRoot }
If (Test-Path -Path "C:\Windows\Sun\Java\Deployment\deployment.config"){
Write-Host "JAVA Deployment Config Already Installed" -ForegroundColor Green -BackgroundColor Black
}Else {
Write-Host "Installing JAVA Deployment Config...." -ForegroundColor Green -BackgroundColor Black
Mkdir "C:\Windows\Sun\Java\Deployment\" -Force
Copy-Item -Path .\Files\deployment.config -Destination "C:\Windows\Sun\Java\Deployment\" -Force
Write-Host "JAVA Configs Installed" -ForegroundColor White -BackgroundColor Black
}
If (Test-Path -Path "C:\Windows\Java\Deployment\"){
Write-Host " JAVA Configs Already Deployed" -ForegroundColor Green -BackgroundColor Black
}Else {
Write-Host "Installing JAVA Configurations...." -ForegroundColor Green -BackgroundColor Black
Mkdir "C:\Windows\Java\Deployment\" -Force
Copy-Item -Path .\Files\deployment.properties -Destination "C:\Windows\Java\Deployment\" -Force
Copy-Item -Path .\Files\exception.sites -Destination "C:\Windows\Java\Deployment\" -Force
Write-Host "JAVA Configs Installed" -ForegroundColor White -BackgroundColor Black
}