changed function GetTempPath to Get-TempPath
This commit is contained in:
@@ -14,7 +14,7 @@ Function SourceTools
|
||||
. SourceTools
|
||||
|
||||
# Build the path for $AGENT_INSTALLER
|
||||
$AGENT_INSTALLER = '{0}{1}' -f (GetTempPath), $AGENT_FILENAME
|
||||
$AGENT_INSTALLER = '{0}{1}' -f (Get-TempPath), $AGENT_FILENAME
|
||||
|
||||
# Make sure we need to install the agent
|
||||
If ( (Test-Path "${Env:ProgramFiles}\ATERA Networks\AteraAgent\AteraAgent.exe") -or (Test-Path "${Env:ProgramFiles(x86)}\ATERA Networks\AteraAgent\AteraAgent.exe") )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
$URL = Get-AbsoluteURI -URL 'https://www.autodesk.com/adsk-connect-64?'
|
||||
|
||||
# Set the local file name to download to
|
||||
$FILE = '{0}{1}' -f (GetTempPath),(Split-Path $URL -Leaf)
|
||||
$FILE = '{0}{1}' -f (Get-TempPath),(Split-Path $URL -Leaf)
|
||||
|
||||
# Download installer
|
||||
Download-File -URL $URL -File $FILE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# NOTE: The $CONFIG variable must be set by the calling script
|
||||
|
||||
# Set path to temp directory
|
||||
$TEMPDIR = '{0}eset-protect-deployment' -f (GetTempPath)
|
||||
$TEMPDIR = '{0}eset-protect-deployment' -f (Get-TempPath)
|
||||
|
||||
# Recursively delete $TEMPDIR if it already exists
|
||||
If ( Test-Path $TEMPDIR ) {
|
||||
|
||||
@@ -12,7 +12,7 @@ Function SourceTools
|
||||
. SourceTools
|
||||
|
||||
## Build the path for $AGENT_INSTALLER
|
||||
$AGENT_INSTALLER = '{0}{1}' -f (GetTempPath), $AGENT_FILENAME
|
||||
$AGENT_INSTALLER = '{0}{1}' -f (Get-TempPath), $AGENT_FILENAME
|
||||
|
||||
## Get the right path to agent.exe based on the system bit-level
|
||||
If ( Is64bit ) { $AGENT_EXE = "${Env:ProgramFiles(x86)}\N-able Technologies\Windows Agent\bin\agent.exe" }
|
||||
|
||||
@@ -13,7 +13,7 @@ If ( IsAdmin )
|
||||
# 'SketchUp 2019', 'SketchUp 2021', 'SketchUp 2022', 'SketchUp 2023', 'SketchUp Viewer' | Uninstall-MSI
|
||||
|
||||
# Set the local file name to download to
|
||||
$FILE = '{0}{1}.exe' -f (GetTempPath),(Split-Path $URL -Leaf)
|
||||
$FILE = '{0}{1}.exe' -f (Get-TempPath),(Split-Path $URL -Leaf)
|
||||
|
||||
# Download installer
|
||||
$FILE = Download-File -URL $URL -File $FILE
|
||||
|
||||
@@ -15,7 +15,7 @@ Function SourceTools
|
||||
. SourceTools
|
||||
|
||||
# Build the path for $AGENT_INSTALLER
|
||||
$AGENT_INSTALLER = '{0}{1}' -f (GetTempPath), $AGENT_FILENAME
|
||||
$AGENT_INSTALLER = '{0}{1}' -f (Get-TempPath), $AGENT_FILENAME
|
||||
|
||||
# Download agent installer
|
||||
Download-File -URL $URL -File "${AGENT_INSTALLER}"
|
||||
|
||||
@@ -193,7 +193,7 @@ Function Download-File {
|
||||
[Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$URL,
|
||||
[Parameter(Mandatory=$false,ValueFromPipeline=$false)][string]$File
|
||||
)
|
||||
If ( !($File) ) { $File = '{0}{1}' -f (GetTempPath), (Split-Path $URL -Leaf) }
|
||||
If ( !($File) ) { $File = '{0}{1}' -f (Get-TempPath), (Split-Path $URL -Leaf) }
|
||||
If ( IsURLValid $URL ) {
|
||||
If ( Test-Path $File ) {
|
||||
LogMsg "Deleting existing file: ""${File}"""
|
||||
@@ -274,7 +274,7 @@ Function IsWindowsBuild {
|
||||
}
|
||||
|
||||
## Get the path to the TEMP folder (context dependent)
|
||||
Function GetTempPath { Return [System.IO.Path]::GetTempPath() }
|
||||
Function Get-TempPath { Return [System.IO.Path]::GetTempPath() }
|
||||
|
||||
## Determine if the system is 64-bit or not
|
||||
Function Is64bit {
|
||||
|
||||
Reference in New Issue
Block a user