1
1
<#
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
13
15
14
16
. SYNOPSIS
15
17
Queries the Audacity webside for the current version of
16
18
the app and returns the version, date updated, and
17
19
download URLs if available.
18
20
19
- . DESCRIPTION
20
- This function retrieves the latest data associated with Audacity
21
+ . DESCRIPTION
22
+ This function retrieves the latest data associated with Audacity
21
23
Invoke-WebRequest queries the site to obtain app release date, version and
22
24
download URLs. This includes x86 and x64.
23
25
It then outputs the information as a
26
28
Release Version obtained from https://www.audacityteam.org/download/windows
27
29
Release date obtained from https://wiki.audacityteam.org/wiki/Audacity_Versions
28
30
29
- . EXAMPLE
31
+ . EXAMPLE
30
32
PS> Get-OnlineVerAudacity
31
33
Software_Name : Audacity
32
34
Software_URL : https://wiki.audacityteam.org/wiki/Release_Notes_3.0.2
38
40
PS C:\> Get-OnlineVerAudacity -Quiet
39
41
3.0.2
40
42
41
- . INPUTS
43
+ . INPUTS
42
44
-Quiet
43
45
Use of this parameter will output just the current version of
44
46
Flash Player instead of the entire object. It will always be the
45
47
last parameter
46
-
47
- . OUTPUTS
48
+
49
+ . OUTPUTS
48
50
An object containing the following:
49
51
Software Name: Name of the software
50
52
Software URL: The URL info was sourced from
55
57
56
58
If -Quiet is specified then just the value of 'Online Version'
57
59
will be displayed.
58
-
60
+
59
61
. NOTES
60
62
Resources/Credits:
61
63
https://github.com/itsontheb
@@ -91,6 +93,28 @@ function Get-OnlineVerAudacity {
91
93
Process {
92
94
# Get the Version & Release Date
93
95
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
+ <#
94
118
$Site = "https://www.audacityteam.org/download/windows/"
95
119
Write-Verbose -Message "Attempting to pull info from the below URL: `n $URI"
96
120
$SiteWiki = "https://wiki.audacityteam.org/wiki/Audacity_Versions"
@@ -103,9 +127,9 @@ function Get-OnlineVerAudacity {
103
127
$AudacityReleaseNotes = "https://wiki.audacityteam.org/wiki/Release_Notes_" + "$AudacityVersion"
104
128
105
129
$swObject.Software_URL = $AudacityReleaseNotes
106
- $swObject .Online_Version = $AudacityVersion
107
- $swObject .Online_Date = $AudacityReleaseDate
108
-
130
+ #>
131
+
132
+
109
133
}
110
134
catch {
111
135
Write-Verbose - Message " Error accessing the below URL: `n $URI "
@@ -118,8 +142,11 @@ function Get-OnlineVerAudacity {
118
142
# Get the Download URLs
119
143
if ($swObject.Online_Version -ne ' UNKNOWN' ) {
120
144
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
+
123
150
$swObject.Download_URL_x86 = $AudacityDownloadx86
124
151
$swObject.Download_URL_x64 = $AudacityDownloadx64
125
152
}
0 commit comments