major logging overhaul, plus other fixes

This commit is contained in:
2020-10-22 14:01:35 -04:00
parent 77cf4d6276
commit 978373ebe2
27 changed files with 430 additions and 611 deletions
+10 -13
View File
@@ -2,22 +2,19 @@
$BaseURL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources'
## Build URL for Windows 10
If ( ([System.Environment]::OSVersion.Version).Major -ge 10 )
If ( IsWindowsVersion -ge "10.0" )
{
If ( Test-Path "${Env:ProgramFiles(x86)}" )
{ $URL = '{0}/{1}' -f $BaseURL, 'DisplayLink_Win10RS_x64.msi' }
Else { $URL = '{0}/{1}' -f $BaseURL, 'DisplayLink_Win10RS_x86.msi' }
If ( Is64bit ) { $URL = '{0}/{1}' -f $BaseURL, 'DisplayLink_Win10RS_x64.msi' }
Else { $URL = '{0}/{1}' -f $BaseURL, 'DisplayLink_Win10RS_x86.msi' }
}
## Build URL for Windows 7
ElseIf ( (([System.Environment]::OSVersion.Version).Major -ge 7) -and (([System.Environment]::OSVersion.Version).Major -lt 10) )
## Build URL for Windows 7, 8, and 8.1
ElseIf ( (IsWindowsVersion -ge "6.1") -and (IsWindowsVersion -lt "10.0") )
{
If ( Test-Path "${Env:ProgramFiles(x86)}" )
{ $URL = '{0}/{1}' -f $BaseURL, 'DisplayLink_Win7-8.1_x64.msi' }
Else { $URL = '{0}/{1}' -f $BaseURL, 'DisplayLink_Win7-8.1_x86.msi' }
If ( Is64bit ) { $URL = '{0}/{1}' -f $BaseURL, 'DisplayLink_Win7-8.1_x64.msi' }
Else { $URL = '{0}/{1}' -f $BaseURL, 'DisplayLink_Win7-8.1_x86.msi' }
}
Else { LogMsg "Operating system is not supported" ; Exit }
## Install package
Write-Output "Installing: ${URL}"
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i ${URL} /qn /norestart" -Wait
## Install DisplayLink
Install-Program -Path "msiexec.exe" -Arguments "/i ${URL} /qn /norestart"