fix logic

This commit is contained in:
2022-11-10 19:33:32 -05:00
parent a6d1172bfd
commit 49749d4f03
+6 -4
View File
@@ -1,10 +1,7 @@
# NOTE: The $CONFIG variable must be set by the calling script
# Create temp directory
# Set path to temp directory
$TEMPDIR = '{0}eset-protect-deployment' -f (GetTempPath)
LogMsg "Creating: ${TEMPDIR}"
Try { New-Item -Path $TEMPDIR -ItemType Directory -Force -ErrorAction Stop }
Catch { LogErr $_.Exception.Message ; Exit }
# Recursively delete $TEMPDIR if it already exists
If ( Test-Path $TEMPDIR ) {
@@ -13,6 +10,11 @@ If ( Test-Path $TEMPDIR ) {
Catch { LogErr $_.Exception.Message }
}
# Create $TEMPDIR
LogMsg "Creating: ${TEMPDIR}"
Try { New-Item -Path $TEMPDIR -ItemType Directory -Force -ErrorAction Stop }
Catch { LogErr $_.Exception.Message ; Exit }
# Write $CONFIG to install_config.ini
Try { $CONFIG | Out-File -FilePath "${TEMPDIR}\install_config.ini" -Force -ErrorAction Stop }
Catch { LogMsg "Cannot write configuration file! This script will exit." ; LogErr $_.Exception.Message ; Exit }