Skip to content

Instantly share code, notes, and snippets.

@andrewmatveychuk
Last active July 17, 2023 18:27
Show Gist options
  • Save andrewmatveychuk/54bedbf5e891a8318a7f2eb765ddab16 to your computer and use it in GitHub Desktop.
Save andrewmatveychuk/54bedbf5e891a8318a7f2eb765ddab16 to your computer and use it in GitHub Desktop.
Using Register-PackageSource to register a PowerShell repository
$patToken = $env:SYSTEM_ACCESSTOKEN | ConvertTo-SecureString -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($env:SYSTEM_ACCESSTOKEN, $patToken)
Register-PackageSource -ProviderName 'PowerShellGet' -Name <YOUR_REPOSITORY_NAME> -Location <REPOSITORY_LOCATION> -Credential $Credentials
Find-Module -Name 'YOUR_MODULE_NAME' -Credential $credential
Install-Module -Name 'YOUR_MODULE_NAME' -Credential $credential
@andrewmatveychuk
Copy link
Author

Hey @ckolumbus,
Thanks for the feedback! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment