added func Install-LocalTools

run Install-LocalTools at every call to this script
This commit is contained in:
2024-06-17 16:45:21 -04:00
parent 475f517417
commit 427e694fb3
+24 -1
View File
@@ -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
Install-LocalTools