From 31a06a9206f44b1465e5aba3a25cb603b4c48574 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Thu, 5 Oct 2023 12:47:08 -0400 Subject: [PATCH] changed function GetTempPath to Get-TempPath --- Install-AteraAgent.ps1 | 2 +- Install-AutodeskDesktopConnector.ps1 | 2 +- Install-ESETManagementAgent.ps1 | 2 +- Install-ManagementAgent.ps1 | 2 +- Install-SketchUp.ps1 | 2 +- Install-SyncroAgent.ps1 | 2 +- Tools.ps1 | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Install-AteraAgent.ps1 b/Install-AteraAgent.ps1 index c28955d..b4b0efe 100644 --- a/Install-AteraAgent.ps1 +++ b/Install-AteraAgent.ps1 @@ -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") ) diff --git a/Install-AutodeskDesktopConnector.ps1 b/Install-AutodeskDesktopConnector.ps1 index 1c582fe..0374f08 100644 --- a/Install-AutodeskDesktopConnector.ps1 +++ b/Install-AutodeskDesktopConnector.ps1 @@ -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 diff --git a/Install-ESETManagementAgent.ps1 b/Install-ESETManagementAgent.ps1 index a437e4e..bc8adee 100644 --- a/Install-ESETManagementAgent.ps1 +++ b/Install-ESETManagementAgent.ps1 @@ -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 ) { diff --git a/Install-ManagementAgent.ps1 b/Install-ManagementAgent.ps1 index 62faa0d..5015964 100644 --- a/Install-ManagementAgent.ps1 +++ b/Install-ManagementAgent.ps1 @@ -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" } diff --git a/Install-SketchUp.ps1 b/Install-SketchUp.ps1 index 743297a..c6b756e 100644 --- a/Install-SketchUp.ps1 +++ b/Install-SketchUp.ps1 @@ -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 diff --git a/Install-SyncroAgent.ps1 b/Install-SyncroAgent.ps1 index bc1c169..0eb8a2c 100644 --- a/Install-SyncroAgent.ps1 +++ b/Install-SyncroAgent.ps1 @@ -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}" diff --git a/Tools.ps1 b/Tools.ps1 index 84a2f10..00e612a 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -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 {