added Download-File function to Tools.ps1

added Install-VLC.ps1 script
This commit is contained in:
2020-10-19 11:24:07 -04:00
parent 5c8d47c428
commit 77cf4d6276
2 changed files with 62 additions and 4 deletions
+27
View File
@@ -0,0 +1,27 @@
. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1')))
## Make sure we're running as admin
If ( IsAdmin )
{
## Get the correct URL
If ( Is64bit)
{ $URL = 'https://get.videolan.org/vlc/3.0.11/win64/vlc-3.0.11-win64.exe' }
Else
{ $URL = 'https://ftp.osuosl.org/pub/videolan/vlc/3.0.11/win32/vlc-3.0.11-win32.exe' }
## Download file and get local file name
$Installer = Download-File $URL
If ( Test-Path $Installer )
{
## Run silent install
Try { Start-Process $Installer -ArgumentList "/S" -Wait }
Catch { Write-Output $_.Exception.Message }
## Delete the file we downloaded
Try { Remove-Item $Installer -Force }
Catch { Write-Output $_.Exception.Message }
}
Else { Write-Output "The URL was not downloaded correctly: ${URL}" }
}
Else { Write-Output "You must run this script as an administrator" }