Skip to content

Update-PSGalleryLocal

SYNOPSIS

Update and synchronize PowerShell modules in a local PSGallery repository.

SYNTAX

Update-PSGalleryLocal [[-Name] <String[]>] [[-GalleryLocal] <String>] [[-GalleryLocalURI] <String>]
 [[-GalleryLocalPath] <String>] [[-GalleryOnline] <String>] [[-GalleryOnlineURI] <String>]
 [[-GitlabURI] <String>] [[-SmtpServer] <String>] [[-MailFrom] <String>] [[-MailTo] <String[]>] [-NoMail]
 [<CommonParameters>]

DESCRIPTION

This function updates PowerShell modules in a local PSGallery repository by comparing them with the online PSGallery. It downloads updated modules, checks for breaking changes, and optionally sends an email notification with the update details. The function also supports excluding email notifications and customizing repository paths and URIs.

EXAMPLES

EXAMPLE 1

Update-PSGalleryLocal -Name '*' -GalleryLocal 'PSGallery_Local'

Updates all modules in the local PSGallery repository 'PSGallery_Local'.

EXAMPLE 2

Update-PSGalleryLocal -Name 'ModuleName' -NoMail

Updates the specified module in the local PSGallery repository without sending email notifications.

EXAMPLE 3

Update-PSGalleryLocal -Name '*' -MailTo '[email protected]'

Updates all modules and sends an email notification to 'admin@example.com'.

PARAMETERS

-Name

The name(s) of the module(s) to update. Defaults to '*', which updates all modules.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: *
Accept pipeline input: False
Accept wildcard characters: False

-GalleryLocal

The name of the local PSGallery repository. Defaults to 'PSGallery_Local'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: PSGallery_Local
Accept pipeline input: False
Accept wildcard characters: False

-GalleryLocalURI

The URI of the local PSGallery repository. Defaults to 'https://sbnuget.gentgrp.gent.be/nuget'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: Https://sbnuget.gentgrp.gent.be/nuget
Accept pipeline input: False
Accept wildcard characters: False

-GalleryLocalPath

The file path to the local PSGallery repository. Defaults to '\\StadGent\AppData\PSGallery\'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: \\StadGent\AppData\PSGallery\
Accept pipeline input: False
Accept wildcard characters: False

-GalleryOnline

The name of the online PSGallery repository. Defaults to 'PSGallery'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: PSGallery
Accept pipeline input: False
Accept wildcard characters: False

-GalleryOnlineURI

The URI of the online PSGallery repository. Defaults to 'https://www.powershellgallery.com/api/v2'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: Https://www.powershellgallery.com/api/v2
Accept pipeline input: False
Accept wildcard characters: False

-GitlabURI

The URI of the GitLab server. Defaults to 'gitlab.gentgrp.gent.be'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: Gitlab.gentgrp.gent.be
Accept pipeline input: False
Accept wildcard characters: False

-SmtpServer

The SMTP server used for sending email notifications. Defaults to 'internalwebmail.gentgrp.gent.be'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: Internalwebmail.gentgrp.gent.be
Accept pipeline input: False
Accept wildcard characters: False

-MailFrom

The sender email address for notifications. Defaults to 'District09 : Systeembeheer \<systeembeheer@district09.gent>'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: District09 : Systeembeheer <[email protected]>
Accept pipeline input: False
Accept wildcard characters: False

-MailTo

The recipient email addresses for notifications. Defaults to a predefined list of recipients.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: @('[email protected]', '[email protected]')
Accept pipeline input: False
Accept wildcard characters: False

-NoMail

A switch to disable email notifications.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES