This cmdlet combines the functions of the Publish-Module and Publish-Script cmdlets from
PowerShellGet v2. Publish-PSResource publishes a resource from the local computer to an online
NuGet-based repository. You can specify the resource by a path containing the module or script
resource files or by pointing a prepackaged .nupkg file.
Примеры
Example 1
This example publishes the module TestModule to the repository registered with highest priority.
Publish-PSResource -Path c:\TestModule
Example 2
This example publishes the module TestModule to the PowerShell Gallery. The API key is a secret
that's generated by the PowerShell Gallery for a user account.
Specifies the path where the NuGet package .nupkg file should be saved. This parameter can be used
in conjunction with the Repository parameter to publish to a repository and also save the exact
same package to the local file system.
This is a dynamic parameter that's only available on the command line when you have supplied the
Path or Nupkg parameters and the Repository parameter for a ContainerRegistry
repository.
The value of the parameter is pre-pended to the package name. This information is only used for
publishing and isn't included in the package metadata. The module prefix controls the visibility of
the module, for example: internal, public, staging.
This parameter is only used when publishing to the Microsoft Artifact Registry (MAR).
Path to the .nupkg file to be published. The .nupkg file could have been created by a previous
run of Publish-PSResource with the DestinationPath parameter. Or, you can create the .nupkg
file using the Compress-PSResource command.
This parameter was added in v1.1.0-preview2 of Microsoft.PowerShell.PSResourceGet.
The path to the module or script file or the path to a folder containing the module or script file
to be published. The cmdlet packages all files in the folder into a .nupkg file before publishing
to the repository.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
Источник этого содержимого можно найти на GitHub, где также можно создавать и просматривать проблемы и запросы на вытягивание. Дополнительные сведения см. в нашем руководстве для участников.