Files
management-scripts/Install-SketchUp.ps1
T

26 lines
787 B
PowerShell
Raw Normal View History

2023-01-13 08:34:55 -05:00
# $InstallVersion must be set by the calling script or specified here
# Make sure we have an administrative token
2020-10-22 14:01:35 -04:00
If ( IsAdmin )
2020-08-30 23:05:07 -04:00
{
2023-01-13 08:34:55 -05:00
# Define URL for downloading the installer
2020-10-22 14:01:35 -04:00
$URL = "https://www.sketchup.com/sketchup/${InstallVersion}/SketchUpPro-exe"
2023-01-13 08:34:55 -05:00
# Make sure the URL is valid before we do anything
2020-10-22 14:01:35 -04:00
If ( IsURLValid $URL )
{
# TODO: Uninstall all versions of SketchUp
#$APP_NAME = "SketchUp*"
#Run-Script -LivePSScript Uninstall-MSI
2022-09-21 20:30:40 -04:00
2023-01-13 08:34:55 -05:00
# Set the local file name to download to
$FILE = '{0}{1}.exe' -f (GetTempPath),(Split-Path $URL -Leaf)
2023-01-13 08:34:55 -05:00
# Download installer
$FILE = Download-File -URL $URL -File $FILE
2020-10-22 14:01:35 -04:00
2023-01-13 08:34:55 -05:00
# Install package
2020-10-22 14:01:35 -04:00
Install-Program -Path $FILE -Arguments "/silent" -Delete
}
2020-08-30 23:05:07 -04:00
}