-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate.ps1
21 lines (17 loc) · 1.3 KB
/
update.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[CmdletBinding()] # Enables -Debug parameter for troubleshooting
param ()
# Set vars to the script and the parent path ($ScriptPath MUST be defined for the UpdateChocolateyPackage function to work)
$ScriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$ParentPath = Split-Path -Parent $ScriptPath
# Import the UpdateChocolateyPackage function
. (Join-Path $ParentPath 'Chocolatey-Package-Updater.ps1')
# Create a hash table to store package information
$packageInfo = @{
PackageName = "StartAllBack" # Package name
ScrapeUrl = 'https://startallback.com/' # URL to scrape for version number
ScrapePattern = '(?<=<span class="title">Download v)[\d.]+' # Regex pattern to match version number
FileUrl = "https://startisback.sfo3.cdn.digitaloceanspaces.com/StartAllBack_{VERSION}_setup.exe" # URL to download the file from
EnvFilePath = "..\.env" # Path to the .env file for alerting
}
# Call the UpdateChocolateyPackage function and pass the hash table
UpdateChocolateyPackage @packageInfo