Skip to content

Commit cfe95a5

Browse files
authored
Merge pull request #151 from joshuapetryk/josh/powershell
Fixes for Powershell install script
2 parents 9cc0989 + 6213639 commit cfe95a5

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

install.ps1

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
Download and install the latest available FOSSA release from GitHub.
66
#>
77

8+
[CmdletBinding()]
9+
Param()
10+
11+
$OldEAP = $ErrorActionPreference #Preserve the original value
812
$ErrorActionPreference = "Stop"
913

1014
$github = "https://github.com"
@@ -25,7 +29,7 @@ if ($releasePage -inotmatch 'href=\"(.*?releases\/download\/.*?windows.*?)\"')
2529
$downloadUri = "$github/$($Matches[1])"
2630
Write-Verbose "Downloading from: $downloadUri"
2731

28-
$TempDir = Join-Path [System.IO.Path]::GetTempPath() "fossa-cli"
32+
$TempDir = Join-Path ([System.IO.Path]::GetTempPath()) "fossa-cli"
2933
if (![System.IO.Directory]::Exists($TempDir)) {[void][System.IO.Directory]::CreateDirectory($TempDir)}
3034

3135
$zipFile = "$TempDir\fossa-cli.zip"
@@ -34,7 +38,11 @@ $zipFile = "$TempDir\fossa-cli.zip"
3438

3539
Expand-Archive -Path $zipFile -DestinationPath $extractDir -Force
3640

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"
3847

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

0 commit comments

Comments
 (0)