< Back

Publish-PSBuildModule

Sat Jan 18, 2020 9:34 pm

NAME Publish-PSBuildModule



SYNOPSIS

Publishes a module to the defined PowerShell repository.





SYNTAX

Publish-PSBuildModule [-Path] <FileInfo> [-Version] <String> [-Repository] <String> [[-NuGetApiKey] <String>]

[[-Credential] <PSCredential>] [<CommonParameters>]





DESCRIPTION

Publishes a module to the defined PowerShell repository.





PARAMETERS

-Path <FileInfo>

The path to the module to publish.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Version <String>

The version of the module to publish.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Repository <String>

The PowerShell repository name to publish to.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NuGetApiKey <String>

The API key to use to authenticate to the PowerShell repository with.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

The credential to use to authenticate to the PowerShell repository with.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS>Publish-PSBuildModule -Path .\\Output\\0.1.0\\MyModule -Version 0.1.0 -Repository PSGallery -NuGetApiKey 12345



Publish version 0.1.0 of the module at path .\\Output\\0.1.0\\MyModule to the PSGallery repository using an API key.









-------------------------- EXAMPLE 2 --------------------------



PS>Publish-PSBuildModule -Path .\\Output\\0.1.0\\MyModule -Version 0.1.0 -Repository PSGallery -Credential $myCred



Publish version 0.1.0 of the module at path .\\Output\\0.1.0\\MyModule to the PSGallery repository using a PowerShell

credential.









-------------------------- EXAMPLE 3 --------------------------



PS>Publish-PSBuildModule -Path .\\Output\\0.1.0\\MyModule -Version 0.1.0 -Repository PSGallery -NuGetApiKey 12345

-Credential $myCred



Publish version 0.1.0 of the module at path .\\Output\\0.1.0\\MyModule to the PSGallery repository using an API key

and a PowerShell credential.











RELATED LINKS