Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55f6409

Browse files
authored
Merge pull request #45 from rwidmark/dev
Dev
2 parents cf05522 + 53fb036 commit 55f6409

4 files changed

Lines changed: 61 additions & 45 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (C) 2024 Robin Stolpe.
3+
Copyright (C) 2025 Robin Widmark.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MaintainModule/MaintainModule.psd1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<#
22
MIT License
33
4-
Copyright (C) 2024 Robin Stolpe.
4+
Copyright (C) 2025 Robin Widmark.
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -25,9 +25,9 @@
2525
#
2626
# Module manifest for module 'MaintainModule'
2727
#
28-
# Generated by: Robin Stolpe
28+
# Generated by: Robin Widmark
2929
#
30-
# Generated on: 2024-07-29
30+
# Generated on: 2025-05-20
3131
#
3232

3333
@{
@@ -36,7 +36,7 @@
3636
RootModule = '.\MaintainModule.psm1'
3737

3838
# Version number of this module.
39-
ModuleVersion = '2.0.3'
39+
ModuleVersion = '2.0.5'
4040

4141
# Supported PSEditions
4242
# CompatiblePSEditions = @()
@@ -45,13 +45,13 @@
4545
GUID = '4fec1769-909e-44cf-b715-bbc6b10564b3'
4646

4747
# Author of this module
48-
Author = 'Robin Stolpe'
48+
Author = 'Robin Widmark'
4949

5050
# Company or vendor of this module
51-
CompanyName = 'Stolpe.io'
51+
CompanyName = 'Widmark.dev'
5252

5353
# Copyright statement for this module
54-
Copyright = '(c) 2024 Robin Stolpe. All rights reserved.'
54+
Copyright = '(c) 2025 Robin Widmark. All rights reserved.'
5555

5656
# Description of the functionality provided by this module
5757
Description = 'This module let you maintain/update your installed PowerShell modules in a easy way'
@@ -122,16 +122,16 @@
122122
Tags = @("PowerShell", "macOS", "Windows", "Linux", "support-tool", "sysadmin-tool", "it-tool", "maintain-module", "module-maintenance", "multi-platform", "multiOS")
123123

124124
# A URL to the license for this module.
125-
LicenseUri = 'https://github.com/rstolpe/MaintainModule/blob/main/LICENSE'
125+
LicenseUri = 'https://github.com/rwidmark/MaintainModule/blob/main/LICENSE'
126126

127127
# A URL to the main website for this project.
128-
ProjectUri = 'https://github.com/rstolpe/MaintainModule'
128+
ProjectUri = 'https://github.com/rwidmark/MaintainModule'
129129

130130
# A URL to an icon representing this module.
131131
# IconUri = ''
132132

133133
# ReleaseNotes of this module
134-
ReleaseNotes = 'https://github.com/rstolpe/MaintainModule/releases'
134+
ReleaseNotes = 'https://github.com/rwidmark/MaintainModule/releases'
135135

136136
# Prerelease string of this module
137137
Prerelease = 'beta'

MaintainModule/MaintainModule.psm1

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<#
22
MIT License
33
4-
Copyright (C) 2024 Robin Stolpe.
4+
Copyright (C) 2025 Robin Widmark.
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -45,24 +45,27 @@ Function Uninstall-rsModule {
4545
# This will uninstall all older versions of all modules in the system
4646
4747
.LINK
48-
https://github.com/rstolpe/MaintainModule/blob/main/README.md
48+
https://github.com/rwidmark/MaintainModule/blob/main/README.md
4949
5050
.NOTES
51-
Author: Robin Stolpe
52-
53-
Twitter: https://twitter.com/rstolpes
54-
Linkedin: https://www.linkedin.com/in/rstolpe/
55-
Website/Blog: https://stolpe.io
56-
GitHub: https://github.com/rstolpe
57-
PSGallery: https://www.powershellgallery.com/profiles/rstolpe
51+
Author: Robin Widmark
52+
53+
Website/Blog: https://widmark.dev
54+
X: https://x.com/widmark_robin
55+
Mastodon: https://mastodon.social/@rwidmark
56+
YouTube: https://www.youtube.com/@rwidmark
57+
Linkedin: https://www.linkedin.com/in/rwidmark/
58+
GitHub: https://github.com/rwidmark
5859
#>
5960

6061
[CmdletBinding(SupportsShouldProcess)]
6162
Param(
6263
[Parameter(Mandatory = $false, HelpMessage = "Enter the module or modules you want to uninstall older version of, if not used all older versions will be uninstalled")]
6364
[string]$Module,
6465
[Parameter(Mandatory = $false, HelpMessage = ".")]
65-
[string[]]$OldVersion
66+
[string[]]$OldVersion,
67+
[Parameter(Mandatory = $false, HelpMessage = "If this is used updates etc. be for prerelease")]
68+
[bool]$AllowPrerelease = $false
6669
)
6770

6871
Write-Output "START - Uninstall older versions of $($Module)"
@@ -71,7 +74,7 @@ Function Uninstall-rsModule {
7174
foreach ($_version in $OldVersion) {
7275
Write-Verbose "Uninstalling version $($_version) of $($Module)..."
7376
try {
74-
Uninstall-Module -Name $Module -RequiredVersion $_version -Force -ErrorAction SilentlyContinue
77+
Uninstall-Module -Name $Module -RequiredVersion $_version -AllowPrerelease:$AllowPrerelease -Force -ErrorAction SilentlyContinue
7578
}
7679
catch {
7780
Write-Error "$($PSItem.Exception)"
@@ -224,16 +227,17 @@ Function Update-rsModule {
224227
# This will update the modules PowerCLI and ImportExcel and delete all of the old versions that are installed of PowerCLI and ImportExcel and then import the modules.
225228
226229
.LINK
227-
https://github.com/rstolpe/MaintainModule/blob/main/README.md
230+
https://github.com/rwidmark/MaintainModule/blob/main/README.md
228231
229232
.NOTES
230-
Author: Robin Stolpe
231-
232-
Twitter: https://twitter.com/rstolpes
233-
Linkedin: https://www.linkedin.com/in/rstolpe/
234-
Website/Blog: https://stolpe.io
235-
GitHub: https://github.com/rstolpe
236-
PSGallery: https://www.powershellgallery.com/profiles/rstolpe
233+
Author: Robin Widmark
234+
235+
Website/Blog: https://widmark.dev
236+
X: https://x.com/widmark_robin
237+
Mastodon: https://mastodon.social/@rwidmark
238+
YouTube: https://www.youtube.com/@rwidmark
239+
Linkedin: https://www.linkedin.com/in/rwidmark/
240+
GitHub: https://github.com/rwidmark
237241
#>
238242

239243
[CmdletBinding(SupportsShouldProcess)]
@@ -248,12 +252,12 @@ Function Update-rsModule {
248252
[Parameter(Mandatory = $false, HelpMessage = "Install all of the modules that has been entered in module that are not installed on the system")]
249253
[switch]$InstallMissing = $false,
250254
[Parameter(Mandatory = $false, HelpMessage = "Don't check publishers certificate")]
251-
[bool]$SkipPublisherCheck = $false,
255+
[switch]$SkipPublisherCheck = $false,
252256
[Parameter(Mandatory = $false, HelpMessage = "If this is used updates etc. be for prerelease")]
253257
[bool]$AllowPrerelease = $false
254258
)
255259

256-
Write-Output "`n=== Module Maintenance - Stolpe.io 2024 ==="
260+
Write-Output "`n=== Module Maintenance - Widmark.dev 2025 ==="
257261
Write-Output "Please wait, this can take some time...`n"
258262

259263
# Making sure that all needed components are installed
@@ -279,13 +283,18 @@ Function Update-rsModule {
279283
try {
280284
Write-Output "Found a newer version of $($_module.Name), version $CollectLatestVersion"
281285
Write-Output "Updating $($_module.Name) from $($_module.LatestVersion) to version $CollectLatestVersion..."
282-
Update-Module -Name $_module.Name -Scope $Scope -AllowPrerelease:$AllowPrerelease -SkipPublisherCheck:$SkipPublisherCheck -AcceptLicense -Force
286+
if ($SkipPublisherCheck -eq $true) {
287+
Update-Module -Name $_module.Name -Scope $Scope -AllowPrerelease:$AllowPrerelease -SkipPublisherCheck -AcceptLicense -Force
288+
}
289+
else {
290+
Update-Module -Name $_module.Name -Scope $Scope -AllowPrerelease:$AllowPrerelease -AcceptLicense -Force
291+
}
283292
Write-Output "$($_module.Name) has now been updated to version $($CollectLatestVersion)!"
284293

285294
# If switch -UninstallOldVersion has been used then the old versions will be uninstalled from the module
286295
if ($UninstallOldVersion -eq $true -and $_module.OldVersion.Count -gt 0) {
287-
Uninstall-rsModule -Module $_module.Name -OldVersion $_module.OldVersion
288-
Uninstall-rsModule -Module $_module.Name -OldVersion $_module.LatestVersion
296+
Uninstall-rsModule -Module $_module.Name -OldVersion $_module.OldVersion -AllowPrerelease:$AllowPrerelease
297+
Uninstall-rsModule -Module $_module.Name -OldVersion $_module.LatestVersion -AllowPrerelease:$AllowPrerelease
289298
}
290299
else {
291300
Write-Verbose "$($_module.Name) don't have any older versions to uninstall!"
@@ -307,7 +316,12 @@ Function Update-rsModule {
307316
if ($InstallMissing -eq $true) {
308317
try {
309318
Write-Output "$($_module.name) are not installed, installing $($_module.name)..."
310-
Install-Module -Name $_module.name -Scope $Scope -AllowPrerelease:$AllowPrerelease -AcceptLicense -Force
319+
if ($SkipPublisherCheck -eq $true) {
320+
Install-Module -Name $_module.name -Scope $Scope -AllowPrerelease:$AllowPrerelease -SkipPublisherCheck -AcceptLicense -Force
321+
}
322+
else {
323+
Install-Module -Name $_module.name -Scope $Scope -AllowPrerelease:$AllowPrerelease -AcceptLicense -Force
324+
}
311325
Write-Output "$($_module.name) has now been installed!"
312326
}
313327
catch {

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
![GitHub](https://img.shields.io/github/license/rstolpe/MaintainModule?style=plastic)
2-
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/rstolpe/MaintainModule?sort=semver&style=plastic) ![Last release](https://img.shields.io/github/release-date/rstolpe/MaintainModule?style=plastic)
3-
![GitHub last commit](https://img.shields.io/github/last-commit/rstolpe/MaintainModule?style=plastic)
1+
![GitHub](https://img.shields.io/github/license/rwidmark/MaintainModule?style=plastic)
2+
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/rwidmark/MaintainModule?sort=semver&style=plastic) ![Last release](https://img.shields.io/github/release-date/rwidmark/MaintainModule?style=plastic)
3+
![GitHub last commit](https://img.shields.io/github/last-commit/rwidmark/MaintainModule?style=plastic)
44
![PSGallery downloads](https://img.shields.io/powershellgallery/dt/MaintainModule?style=plastic)
55

66
# MaintainModule
@@ -19,14 +19,16 @@ Works on all OS versions.
1919
- Update / install Pre-release
2020

2121
## Dependencies
22-
- Module also require that you have my service module installed, [rsServiceModule](https://github.com/rstolpe/rsServiceModule)
22+
- Module also require that you have my service module installed, [rsServiceModule](https://github.com/rwidmark/rsServiceModule)
2323

2424
# Links
25-
* [My PowerShell Collection](https://github.com/rstolpe/PSCollection)
26-
* [Webpage/Blog](https://www.stolpe.io)
27-
* [Twitter](https://twitter.com/rstolpes)
28-
* [LinkedIn](https://www.linkedin.com/in/rstolpe/)
29-
* [PowerShell Gallery](https://www.powershellgallery.com/profiles/rstolpe)
25+
* [My PowerShell Collection](https://github.com/rwidmark/PSCollection)
26+
* [Webpage/Blog](https://widmark.dev)
27+
* [X](https://twitter.com/widmark_robin)
28+
* [Mastodon](https://mastodon.social/@rwidmark)
29+
* [YouTube](https://www.youtube.com/@rwidmark)
30+
* [LinkedIn](https://www.linkedin.com/in/rwidmark/)
31+
* [GitHub](https://github.com/rwidmark)
3032

3133

3234
## Notes

0 commit comments

Comments
 (0)