File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 5
5
Download and install the latest available FOSSA release from GitHub.
6
6
#>
7
7
8
+ [CmdletBinding ()]
9
+ Param ()
10
+
11
+ $OldEAP = $ErrorActionPreference # Preserve the original value
8
12
$ErrorActionPreference = " Stop"
9
13
10
14
$github = " https://github.com"
@@ -25,7 +29,7 @@ if ($releasePage -inotmatch 'href=\"(.*?releases\/download\/.*?windows.*?)\"')
25
29
$downloadUri = " $github /$ ( $Matches [1 ]) "
26
30
Write-Verbose " Downloading from: $downloadUri "
27
31
28
- $TempDir = Join-Path [System.IO.Path ]::GetTempPath() " fossa-cli"
32
+ $TempDir = Join-Path ( [System.IO.Path ]::GetTempPath() ) " fossa-cli"
29
33
if (! [System.IO.Directory ]::Exists($TempDir )) {[void ][System.IO.Directory ]::CreateDirectory($TempDir )}
30
34
31
35
$zipFile = " $TempDir \fossa-cli.zip"
@@ -34,7 +38,11 @@ $zipFile = "$TempDir\fossa-cli.zip"
34
38
35
39
Expand-Archive - Path $zipFile - DestinationPath $extractDir - Force
36
40
37
- $ErrorActionPreference = " Continue"
41
+ $ErrorActionPreference = $OldEAP
42
+
43
+ $fossa = " $extractDir \fossa.exe"
44
+
45
+ Write-Host " Installed fossa-cli at: $fossa "
46
+ Write-Host " Get started by running: fossa.exe --help"
38
47
39
- Write-Verbose " Installed fossa-cli at: $extractDir \fossa-cli\fossa.exe"
40
- Write-Verbose " Get started by running: fossa.exe --help"
48
+ Write-Output $fossa
You can’t perform that action at this time.
0 commit comments