Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Created March 30, 2018 12:35
Show Gist options
  • Save johnmmoss/f2ca7c1d562bef4b9609742005d2e8dc to your computer and use it in GitHub Desktop.
Save johnmmoss/f2ca7c1d562bef4b9609742005d2e8dc to your computer and use it in GitHub Desktop.
# Add TFS Package Management Source for Nuget
nuget.exe sources add -name Powershell -source http://url/to/package/repo/index.json -username VSTS -password "pat-from-tfs" -storePasswordInClearText
# Register the PowershellGet source
Register-PSRepository -Name Powershell -SourceLocation http://url/to/package/repo/index.json -PackageManagementProvider NuGet -PublishLocation http://url/to/package/repo/index.json -InstallationPolicy Trusted -Credential Get-Credential
# Finally we can push the loaded module to our TFS Repository
Publish-Module -Name Greetings -Repository Powershell -NuGetApiKey "pat-from-tfs" -Credential Get-Credential
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment