fix logic
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user