Skip to content

Commit 63fffca

Browse files
committed
App source updated to Github feed
1 parent a62861c commit 63fffca

File tree

1 file changed

+50
-23
lines changed

1 file changed

+50
-23
lines changed

Get-OnlineVerAudacity.ps1

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<#
2-
===========================================================================
3-
Created with: VS Code 1.56.1/ISE 19042
4-
Revision: v1
5-
Last Modified: 19 May 2021
6-
Created by: Jay Harper (github.com/thecatdidit/powershellusefulscripts)
7-
Organizaiton: Happy Days Are Here Again
8-
Filename: Get-OnlineVerAudacity.ps1
9-
===========================================================================
10-
.CHANGELOG
11-
[2021.05.20]
12-
Script creation
2+
===========================================================================
3+
Created with: VS Code 1.56.1/ISE 19042
4+
Revision: 2022.05.24
5+
Last Modified: 24 May 2022
6+
Created by: Jay Harper (github.com/thecatdidit/powershellusefulscripts)
7+
Organizaiton: Happy Days Are Here Again
8+
Filename: Get-OnlineVerAudacity.ps1
9+
===========================================================================
10+
.CHANGELOG
11+
[2022.05.24]
12+
Changed version query source to Github release feed
13+
[2021.05.20]
14+
Script creation
1315
1416
.SYNOPSIS
1517
Queries the Audacity webside for the current version of
1618
the app and returns the version, date updated, and
1719
download URLs if available.
1820
19-
.DESCRIPTION
20-
This function retrieves the latest data associated with Audacity
21+
.DESCRIPTION
22+
This function retrieves the latest data associated with Audacity
2123
Invoke-WebRequest queries the site to obtain app release date, version and
2224
download URLs. This includes x86 and x64.
2325
It then outputs the information as a
@@ -26,7 +28,7 @@
2628
Release Version obtained from https://www.audacityteam.org/download/windows
2729
Release date obtained from https://wiki.audacityteam.org/wiki/Audacity_Versions
2830
29-
.EXAMPLE
31+
.EXAMPLE
3032
PS> Get-OnlineVerAudacity
3133
Software_Name : Audacity
3234
Software_URL : https://wiki.audacityteam.org/wiki/Release_Notes_3.0.2
@@ -38,13 +40,13 @@
3840
PS C:\> Get-OnlineVerAudacity -Quiet
3941
3.0.2
4042
41-
.INPUTS
43+
.INPUTS
4244
-Quiet
4345
Use of this parameter will output just the current version of
4446
Flash Player instead of the entire object. It will always be the
4547
last parameter
46-
47-
.OUTPUTS
48+
49+
.OUTPUTS
4850
An object containing the following:
4951
Software Name: Name of the software
5052
Software URL: The URL info was sourced from
@@ -55,7 +57,7 @@
5557
5658
If -Quiet is specified then just the value of 'Online Version'
5759
will be displayed.
58-
60+
5961
.NOTES
6062
Resources/Credits:
6163
https://github.com/itsontheb
@@ -91,6 +93,28 @@ function Get-OnlineVerAudacity {
9193
Process {
9294
# Get the Version & Release Date
9395
try {
96+
97+
98+
$Site = "https://api.github.com/repos/audacity/audacity/releases/latest"
99+
$AppInfo = (Invoke-WebRequest -Uri $Site -UseBasicParsing).Content | ConvertFrom-Json
100+
#Obtain app release version
101+
$AppVersion = $AppInfo.tag_name
102+
$Begin = $AppVersion.IndexOf("-") + 1
103+
$End = $AppVersion.Length
104+
$AppVersion = $AppVersion.Substring($begin,$End - $Begin)
105+
#Obtain app relase date
106+
$AppDate = $AppInfo.created_at
107+
$Begin = 0
108+
$End = $AppDate.IndexOf("T")
109+
$AppDate = $AppDate.Substring(0,$End)
110+
#Obtain URL for the current release notes
111+
$AppNotes = "https://wiki.audacityteam.org/wiki/Release_Notes_" + "$AppVersion"
112+
113+
$swObject.Online_Version = $AppVersion
114+
$swObject.Online_Date = $AppDate
115+
$swObject.Software_URL = $AppNotes
116+
117+
<#
94118
$Site = "https://www.audacityteam.org/download/windows/"
95119
Write-Verbose -Message "Attempting to pull info from the below URL: `n $URI"
96120
$SiteWiki = "https://wiki.audacityteam.org/wiki/Audacity_Versions"
@@ -103,9 +127,9 @@ function Get-OnlineVerAudacity {
103127
$AudacityReleaseNotes = "https://wiki.audacityteam.org/wiki/Release_Notes_" + "$AudacityVersion"
104128
105129
$swObject.Software_URL = $AudacityReleaseNotes
106-
$swObject.Online_Version = $AudacityVersion
107-
$swObject.Online_Date = $AudacityReleaseDate
108-
130+
#>
131+
132+
109133
}
110134
catch {
111135
Write-Verbose -Message "Error accessing the below URL: `n $URI"
@@ -118,8 +142,11 @@ function Get-OnlineVerAudacity {
118142
# Get the Download URLs
119143
if ($swObject.Online_Version -ne 'UNKNOWN') {
120144

121-
$AudacityDownloadx86 = "https://www.fosshub.com/Audacity.html/audacity-win-" + "$AudacityVersion.exe"
122-
$AudacityDownloadx64 = "https://www.fosshub.com/Audacity.html/audacity-win-" + "$AudacityVersion.exe"
145+
#Sample Download URL
146+
#https://github.com/audacity/audacity/releases/download/Audacity-3.1.3/audacity-win-3.1.3-64bit.exe
147+
$AudacityDownloadx86 = "https://github.com/audacity/audacity/releases/download/Audacity-" + $AppVersion + "/audacity-win-" + $AppVersion + "-32bit.exe"
148+
$AudacityDownloadx64 = "https://github.com/audacity/audacity/releases/download/Audacity-" + $AppVersion + "/audacity-win-" + $AppVersion + "-64bit.exe"
149+
123150
$swObject.Download_URL_x86 = $AudacityDownloadx86
124151
$swObject.Download_URL_x64 = $AudacityDownloadx64
125152
}

0 commit comments

Comments
 (0)