Last active
January 26, 2021 18:14
-
-
Save joshjohanning/4788111b31edbb4be49a3ac2f8519671 to your computer and use it in GitHub Desktop.
Migrate NuGet Packages script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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