Skip to content

Commit

Permalink
Update get-latest-tgf.ps1 script to require PowerShell 7 or higher (#415
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pballandras authored Jan 16, 2024
1 parent 48f6c85 commit b9ccf40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ You can run the `get-latest-tgf.sh` script to check if you have the latest versi
curl https://raw.githubusercontent.com/coveooss/tgf/master/get-latest-tgf.sh | bash
```

On `Windows`, run `get-latest-tgf.ps1` with Powershell:
On `Windows`, run `get-latest-tgf.ps1` with Powershell (version 7.x or more):

```PowerShell
(Invoke-WebRequest https://raw.githubusercontent.com/coveooss/tgf/master/get-latest-tgf.ps1).Content | Invoke-Expression
Expand Down
6 changes: 6 additions & 0 deletions get-latest-tgf.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
$ErrorActionPreference = "Stop" #Make all errors terminating

# This script uses Powershell 7 features. Make sure we are running in Powershell 7.
if ($PSVersionTable.PSVersion.Major -lt 7) {
Write-Host "The tgf install script requires PowerShell 7 or higher. Please install PowerShell 7 and try again."
Exit 1
}

try {
$latestReleaseRequest = @{
Method = "HEAD"
Expand Down

0 comments on commit b9ccf40

Please sign in to comment.