Skip to content

Instantly share code, notes, and snippets.

@mattmhersh
Last active September 22, 2015 15:48
Show Gist options
  • Save mattmhersh/c019d9212bdfa0735745 to your computer and use it in GitHub Desktop.
Save mattmhersh/c019d9212bdfa0735745 to your computer and use it in GitHub Desktop.
clear
function publish_packages ($local_dir) {
Get-ChildItem -Path $local_dir -Filter *.nupkg |
Foreach-Object{
$package = $_.Name
Write-Host "Publishing Package: $package"
$nugetPath = "C:\develop\NuGet\NuGet.exe"
$nuget_api_key = 'Username:Password'
$nuget_feed_source = "http://proget.com:81/nuget/Nuget.org+Backup"
& $nugetPath push $local_dir\$package -ApiKey $nuget_api_key -Source $nuget_feed_source
Write-Host "Published Package: $package"
}
}
publish_packages C:\Users\username\Documents\NuGetLocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment