File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,12 @@ $DebugPreference = "Continue"
55Set-StrictMode - version Latest
66
77$here = Split-Path - Parent $MyInvocation.MyCommand.Path
8- . $PSScriptRoot \..\Shared- Functions\ModuleLoader.ps1 " $PSScriptRoot "
98
9+ . $PSScriptRoot \Shared- Functions.ps1
10+
11+ . $PSScriptRoot \Functions.ps1
12+
13+ _Initalize
1014
1115Describe " Remove-AllPSBookmarks" {
1216
Original file line number Diff line number Diff line change 1212# RootModule = ''
1313
1414# Version number of this module.
15- ModuleVersion = ' 2.1.1 '
15+ ModuleVersion = ' 2.1.5 '
1616
1717# Supported PSEditions
1818# CompatiblePSEditions = @()
@@ -115,7 +115,8 @@ PrivateData = @{
115115 Move initation logic to Loader.psm1
116116 Change test environment to StrictMode=Latest
117117 Update icon.
118- Remove extra hared functions
118+ Remove extra shared functions
119+ Add update checker
119120 '
120121
121122 } # End of PSData hashtable
Original file line number Diff line number Diff line change 1- . $PSScriptRoot \Functions.ps1
2- . $PSScriptRoot \Shared- Functions.ps1
1+ . $PSScriptRoot \Shared- Functions.ps1
32
3+ . $PSScriptRoot \Functions.ps1
4+
5+ CheckPsGalleryUpdate Bookmarks " 2.1.5"
46
57_Initalize
68
Original file line number Diff line number Diff line change 11
22function _Initalize () {
3-
3+
44 $script :_marks = @ { }
55 $script :_marksPath = Get-ProfileDataFile bookmarks " Bookmarks"
66
Original file line number Diff line number Diff line change @@ -109,11 +109,17 @@ Clear bookmarks:
109109
110110## Changelog
111111
112- ### [ v1.2.0 ] ( https://github.com/stadub/PowershellScripts/releases/tag/v0.2.2 )
112+ ### [ v2.1.5 ] ( https://github.com/stadub/PowershellScripts/tree/Bookmarks-Release-2.1.5 )
113113
114- * Tests added
115- * Added function ` Remove-AllPSBookmarks `
116- * Fix bookmarks collection access
114+ * Add update checker
115+
116+ ### [ v2.1.0] ( https://github.com/stadub/PowershellScripts/tree/Bookmarks-Release-2.1 )
117+
118+ * Change %userData% detection logic.
119+ * Move initation logic to Loader.psm1
120+ * Change test environment to StrictMode=Latest
121+ * Update icon.
122+ * Remove extra shared functions
117123
118124
119125### [ v1.1.3] ( https://github.com/stadub/PowershellScripts/releases/tag/v0.2.0 )
Original file line number Diff line number Diff line change @@ -69,5 +69,43 @@ function Combine-Path {
6969 [IO.Path ]::Combine([string []]$allArgs )
7070}
7171
72- $_sharedLoaded = $true
72+ filter Last {
73+ BEGIN
74+ {
75+ $current = $null
76+ }
77+ PROCESS
78+ {
79+ $current = $_
80+ }
81+ END
82+ {
83+ Write-Output $current
84+ }
85+ }
86+
87+ function CheckPsGalleryUpdate {
88+ param (
89+ [string ] $moduleName ,
90+ [string ] $currentVersion
91+ )
92+
93+ Try
94+ {
95+ Write-Output " Update check..."
96+ $feed = Invoke-WebRequest - Uri " https://www.powershellgallery.com/api/v2/FindPackagesById()?id=%27$moduleName %27"
97+ $last = ([xml ]$feed.Content ).feed.entry | Sort-Object - Property updated | Last
7398
99+ $version = $last.properties.Version
100+
101+ if ($version -gt $currentVersion ) {
102+ Write-Output " Found a new module version {$version }."
103+ $notes = $last.properties.ReleaseNotes .' #text'
104+ Write-Output " Release notes: {$notes }."
105+ Write-Output " Recomendent to update module with command: Update-Module -Name $moduleName -Force"
106+ }
107+ }
108+ Catch
109+ {
110+ }
111+ }
You can’t perform that action at this time.
0 commit comments