Update Win10 to 1804 & Fixes

This commit is contained in:
Chris Long
2018-06-23 23:27:23 -07:00
parent e4de69aa3c
commit bd6c3520f3
19 changed files with 145 additions and 74 deletions

View File

@@ -1,7 +1,6 @@
# Purpose: Installs the Caldera agent on the host
if (-not (Test-Path 'C:\Program Files\cagent\cagent.exe'))
{
If (-not (Test-Path 'C:\Program Files\cagent\cagent.exe')) {
# Add /etc/hosts entry
Add-Content "c:\windows\system32\drivers\etc\hosts" " 192.168.38.5 logger"
@@ -21,13 +20,15 @@ if (-not (Test-Path 'C:\Program Files\cagent\cagent.exe'))
# Ignore SSL warning for conf file download
# https://stackoverflow.com/questions/34331206/ignore-ssl-warning-with-powershell-downloadstring
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ;(New-Object System.Net.WebClient).DownloadFile('https://logger:8888/conf.yml', $cagentConfPath)
If (-not (Test-Path "$cagentConfPath" )) {
Write-Host "Caldera Agent configuration failed. Unable to retrieve config from logger"
}
Start-Process -FilePath $cagentPath -ArgumentList '--startup', 'auto', 'install' -Wait
Start-Process -FilePath $cagentPath -ArgumentList 'start' -Wait
Start-Process -FilePath $cagentPath -ArgumentList 'start' -Wait
} Else {
Write-Host "Caldera Agent is already installed. Moving on."
}
If ((Get-Service -name cagent).Status -ne "Running")
{
If ((Get-Service -name cagent).Status -ne "Running") {
throw "Caldera Agent service not running"
}
Write-Host "Cagent installation complete!"