summaryrefslogtreecommitdiff
path: root/src/mongo/installer/compass/Install-Compass.ps1.in
blob: 001ae9de0851f285cf1b7f593bc9300ad2a5e792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#Requires -Version 3.0
<#
.SYNOPSIS
    Download and install latest version of MongoDB Compass.

.DESCRIPTION
    A longer description.

.INPUTS
    Description of objects that can be piped to the script

.OUTPUTS
    Description of objects that are output by the script

.EXAMPLE
    Example of how to run the script

.LINK
    Links to further documentation

.NOTES
    Detail on what the script does, if this is needed
#>
param()
$ErrorActionPreference = 'Stop'

$CompassUrl = 'https://compass.mongodb.com/api/v2/download/latest/@compass_type@/stable/windows'

$TemporaryDir = [System.IO.Path]::GetTempPath()
$CompassExe = "$TemporaryDir" + "compass-install.exe"

Remove-Item $CompassExe -ErrorAction:Ignore

Write-Output "Downloading Compass from $CompassUrl"
Invoke-WebRequest -Uri $CompassUrl -OutFile $CompassExe

Write-Output "Installing Compass"
& $CompassExe

# Remove the binary we downloaded
Remove-Item $CompassExe -ErrorAction:Ignore

Write-Output "Successfully installed Compass"