Skip to content

Commit

Permalink
Fix missing '$module.' Add AllowPrerelease.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamErde committed Aug 22, 2024
1 parent 72e75e0 commit b967c8a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Public/Update-AllTheThings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ function Update-AllTheThings {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', 'Update-AllTheThings', Justification = 'Riding the "{___} all the things train!"')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Justification = 'Interactive Use')]
[Alias('UATT')]
param ()
param (
# Allow updates to pre-release PowerShell modules
[Parameter()]
[switch]
$AllowPrerelease
)

begin {
# Spacing to get host output from script, winget, and choco all below the progress bar.
Expand Down Expand Up @@ -117,7 +122,11 @@ function Update-AllTheThings {

# Update the current module
try {
Update-Module $ -ErrorAction SilentlyContinue
if ($AllowPrerelease.IsPresent) {
Update-Module $module -AllowPrerelease -ErrorAction SilentlyContinue
} else {
Update-Module $module -ErrorAction SilentlyContinue
}
} catch [Microsoft.PowerShell.Commands.WriteErrorException] {
Write-Verbose $_
}
Expand Down

0 comments on commit b967c8a

Please sign in to comment.