Skip to content

Instantly share code, notes, and snippets.

@joshjohanning
Last active January 26, 2021 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshjohanning/4788111b31edbb4be49a3ac2f8519671 to your computer and use it in GitHub Desktop.
Save joshjohanning/4788111b31edbb4be49a3ac2f8519671 to your computer and use it in GitHub Desktop.
Migrate NuGet Packages script
echo -n "NuGet feed name?"
read nugetfeed
echo -n "NuGet feed source?"
read nugetsource
echo -n "Enter PAT"
read pat
# adding to ~/.config/NuGet/NuGet.config
nuget sources add -Name $nugetfeed -Source $nugetsource -username "az" -password $pat
results=$(find . -name "*.nupkg")
resultsArray=($results)
for pkg in "${resultsArray[@]}"
do
echo $pkg
nuget push -Source $nugetfeed -ApiKey az $pkg
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment