From 427e694fb3eb6ed94dcc9cf0b28b01574774286c Mon Sep 17 00:00:00 2001 From: David Yoder Date: Mon, 17 Jun 2024 16:45:21 -0400 Subject: [PATCH] added func Install-LocalTools run Install-LocalTools at every call to this script --- Tools.ps1 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Tools.ps1 b/Tools.ps1 index 3b8c3a2..4643bad 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -1009,6 +1009,29 @@ Function Restart-EndpointOnUptime ([timespan]$MaxUptime) { Catch { Write-Error $_.Exception.Message } } +Function Install-LocalTools () { + param( + [Parameter(ValueFromPipeline=$false,Mandatory=$false)][switch]$Force + ) + + $ToolURLs = @( + 'https://www.emberkom.com/tools/BlueScreenView-x64.exe' + 'https://www.emberkom.com/tools/BlueScreenView-x86.exe' + 'https://www.emberkom.com/tools/dnshelper.exe' + 'https://www.emberkom.com/tools/etl2pcapng.exe' + ) + + Foreach ( $ToolURL in $ToolURLs ) { + $ToolName = Split-Path -Leaf $ToolURL + $ToolPath = $Global:ToolsDirectory + '\' + $ToolName + + If ( (Test-Path $ToolPath) -and ($Force -eq $false) ) { Continue } + + Write-Output "Installing ${ToolName}" + Download-File -URL $ToolURL -File $ToolPath + } +} + Setup-MSPDirectories Setup-LogFile -#SetToolsScriptLocation \ No newline at end of file +Install-LocalTools