diff options
author | vnugent <public@vaughnnugent.com> | 2024-01-21 21:57:54 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-01-21 21:57:54 -0500 |
commit | a44f7b7dc089776a7817cf077b3f3ae3db7fc22e (patch) | |
tree | 089bfa7e9eba560f9ae596568d6d981939e597f3 /ci/install.ps1 | |
parent | 6cb7da37824d02a1898d08d0f9495c77fde4dd1d (diff) |
configure ci, patch totp, and bookmarks context
Diffstat (limited to 'ci/install.ps1')
-rw-r--r-- | ci/install.ps1 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ci/install.ps1 b/ci/install.ps1 new file mode 100644 index 0000000..4c42c18 --- /dev/null +++ b/ci/install.ps1 @@ -0,0 +1,26 @@ +param([String] $BaseUrl, [String] $ModuleName, [String] $ProjectName, [String]$FileName) + +#get the latest file +Invoke-WebRequest "$BaseUrl/$ModuleName/@latest" -OutFile latest.txt +#read the file into a variable +$latest = Get-Content latest.txt + +#download the latest version +Invoke-WebRequest "$BaseUrl/$ModuleName/$latest/$ProjectName/$FileName" -OutFile $FileName + +#download latest sha256 +Invoke-WebRequest "$BaseUrl/$ModuleName/$latest/$ProjectName/$FileName.sha256" -OutFile "$FileName.sha256" + +#verify the file +$hash = (Get-FileHash $FileName -Algorithm SHA256).Hash + +#read the sha256 file +$sha256 = Get-Content "$FileName.sha256" + +#compare the hashes +if ($hash -eq $sha256) { + Write-Host "Hashes match, file is valid" -ForegroundColor Blue +} else { + throw "Hashes do not match, file is invalid" +} + |