added Download-File function to Tools.ps1
added Install-VLC.ps1 script
This commit is contained in:
@@ -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" }
|
||||
Reference in New Issue
Block a user