Compare commits
2
Commits
73f976c38a
...
ba077b572a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba077b572a | ||
|
|
d11dad75ca |
@@ -16,7 +16,8 @@ Try { New-Item -Path $TEMPDIR -ItemType Directory -Force -ErrorAction Stop }
|
|||||||
Catch { LogErr $_.Exception.Message ; Exit }
|
Catch { LogErr $_.Exception.Message ; Exit }
|
||||||
|
|
||||||
# Write $CONFIG to install_config.ini
|
# Write $CONFIG to install_config.ini
|
||||||
Try { $CONFIG | Out-File -FilePath "${TEMPDIR}\install_config.ini" -Force -ErrorAction Stop }
|
#Try { $CONFIG | Out-File -FilePath "${TEMPDIR}\install_config.ini" -Force -ErrorAction Stop }
|
||||||
|
Try { $CONFIG | WriteToFile_UTF8NoBOM -FilePath "${TEMPDIR}\install_config.ini" }
|
||||||
Catch { LogMsg "Cannot write configuration file! This script will exit." ; LogErr $_.Exception.Message ; Exit }
|
Catch { LogMsg "Cannot write configuration file! This script will exit." ; LogErr $_.Exception.Message ; Exit }
|
||||||
|
|
||||||
# Get bitness of endpoint and set $AGENTNAME
|
# Get bitness of endpoint and set $AGENTNAME
|
||||||
@@ -24,8 +25,8 @@ If ( Is64bit ) { $AGENTNAME = "agent_x64.msi" } Else { $AGENTNAME = "agent_x86.m
|
|||||||
|
|
||||||
# Download the installer
|
# Download the installer
|
||||||
$INSTALLER = "${TEMPDIR}\${AGENTNAME}"
|
$INSTALLER = "${TEMPDIR}\${AGENTNAME}"
|
||||||
#$URL = 'https://download.eset.com/com/eset/apps/business/era/agent/latest/{0}' -f $AGENTNAME
|
$URL = 'https://download.eset.com/com/eset/apps/business/era/agent/latest/{0}' -f $AGENTNAME
|
||||||
$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/eset_protect_{0}' -f $AGENTNAME
|
#$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/eset_protect_{0}' -f $AGENTNAME
|
||||||
LogMsg "Downloading ESET Management Agent"
|
LogMsg "Downloading ESET Management Agent"
|
||||||
Download-File -URL $URL -File $INSTALLER
|
Download-File -URL $URL -File $INSTALLER
|
||||||
|
|
||||||
|
|||||||
@@ -723,5 +723,16 @@ function Get-FileSizes {
|
|||||||
LogMsg $logstr
|
LogMsg $logstr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to write text to a file in UTF8 encoding without BOM
|
||||||
|
function WriteToFile_UTF8NoBOM {
|
||||||
|
param(
|
||||||
|
[Parameter(ValueFromPipeline=$false)][string]$FilePath,
|
||||||
|
[Parameter(ValueFromPipeline=$true)][string]$Value
|
||||||
|
)
|
||||||
|
$UTF8NoBOM = New-Object System.Text.UTF8Encoding $false
|
||||||
|
Try { [IO.File]::WriteAllText($FilePath, $CONFIG, $UTF8NoBOM) }
|
||||||
|
Catch { LogErr $_.Exception.Message }
|
||||||
|
}
|
||||||
|
|
||||||
Setup-MSPDirectories
|
Setup-MSPDirectories
|
||||||
Setup-LogFile
|
Setup-LogFile
|
||||||
Reference in New Issue
Block a user