MyGit
🚩收到GitHub仓库的更新通知

deadlydog/New-NuGetPackage

Fork: 11 Star: 21 (更新于 2024-04-23 08:25:44)

license: MIT

Language: PowerShell .

New-NuGetPackage.ps1 is a PowerShell script to make creating and publishing NuGet packages quick and easy, using a .nuspec or project file, from File Explorer or PowerShell.

最后发布版本: v1.5.11 ( 2018-10-18 12:01:58)

GitHub网址

✨免费申请网站SSL证书,支持多域名和泛域名,点击查看

New-NuGetPackage PowerShell Script Description

New-NuGetPackage.ps1 is a PowerShell script to make creating and publishing NuGet packages quick and easy, using a .nuspec or project file, from Explorer or PowerShell.

This script is also used by a NuGet Package that you can use to automate making your project's NuGet packages in Visual Studio.

This script depends on nuget.exe, and it is recommended that you add nuget to your PATH.

[!NOTE] This script and package is most useful for .NET Framework projects. .NET Core projects can natively be configured to create a NuGet package on every build, and it can be published from the command-line with dotnet nuget push.

Features

  • The script uses nuget.exe to pack a .nuspec or project file (.csproj, .vbproj, .fsproj) and optionally push it to a NuGet gallery.
  • Can be ran from PowerShell or directly from Windows Explorer (e.g. double-click it, or right-click -> Run with PowerShell).
  • If no parameters are provided the user will be prompted for:
    • the .nuspec or project file to pack, or package to push (if one can't be found automatically)
    • the version number and release notes to use for the package (if a .nuspec file is used)
    • whether the package should be pushed to a NuGet gallery or not.
  • Parameters may be provided to supply these values and/or suppress the prompts, so it can be integrated into your build system.

The script provides parameters for the Pack and Push Options, which will be passed as-is to nuget.exe, allowing for all of the same functionality as calling nuget.exe directly yourself.

Getting Started Quickly

Here are a couple examples of how to run the script from PowerShell to have the GUI prompt you for the required parameters:

& .\New-NuGetPackage.ps1    # Can use relative path when in same directory as the script.
& "C:\Some Folder\New-NuGetPackage.ps1"   # Use absolute path to run script from anywhere.

Below are some examples of calling the script with parameters to avoid the GUI prompts. For more information on the script and its parameters, check out the documentation.

& ".\New-NuGetPackage.ps1" -NuSpecFilePath ".\Some Folder\SomeNuSpecFile.nuspec"
& .\New-NuGetPackage.ps1 -ProjectFilePath "C:\Some Folder\TestProject.csproj" -VersionNumber "1.1" -ReleaseNotes "Version 1.1 contains many bug fixes."
& .\New-NuGetPackage.ps1 -ProjectFilePath "C:\Some Folder\TestProject.csproj" -PackOptions "-Build -OutputDirectory ""C:\Output""" -UsePowerShellPrompts
& .\New-NuGetPackage.ps1 -NuSpecFilePath "C:\Some Folder\SomeNuSpecFile.nuspec" -NoPrompt
& .\New-NuGetPackage.ps1 -NuSpecFilePath ".\Some Folder\SomeNuSpecFile.nuspec" -VersionNumber "9.9.9.9" -DoNotUpdateNuSpecFile
& .\New-NuGetPackage.ps1 -PushPackageToNuGetGallery -PushOptions "-Source ""http://my.server.com/MyNuGetGallery"" -ApiKey ""EAE1E980-5ECB-4453-9623-F0A0250E3A57"""
& .\New-NuGetPackage.ps1 -NuGetExecutableFilePath "C:\Utils\NuGet.exe"
& .\New-NuGetPackage.ps1 -PackageFilePath "C:\Some Folder\MyPackage.nupkg"

最近版本更新:(数据更新于 2024-04-21 12:08:24)

2018-10-18 12:01:58 v1.5.11

2018-09-17 04:45:10 v1.5.10

主题(topics):

hacktoberfest, nuget, nuget-packages, powershell-module, powershell-script

deadlydog/New-NuGetPackage同语言 PowerShell最近更新仓库

2024-04-16 16:50:17 actions/runner-images

2024-04-13 01:34:06 dataplat/dbatools

2024-04-12 01:41:23 dotnet/core

2024-03-27 23:45:58 PSAppDeployToolkit/PSAppDeployToolkit

2024-02-09 17:46:21 denoland/deno_install

2023-12-16 00:04:29 k8gege/Ladon