Product: PowerShell Universal
Version: 3.3.3
I’m trying to add our PowerShell repository that is hosted on Azure DevOps. I initially followed the instructions for adding a private repository before finding out that I needed to be using cmdlets from PSGet v3.
However, when running the following script I am getting an error with the credentials:
$parameters = @{
Name = "myorgPowerShell"
Uri = "https://pkgs.dev.azure.com/myorg/Infrastructure/_packaging/myorgPowerShell/nuget/v3"
Trusted = $true
Priority = 50
CredentialInfo = New-Object Microsoft.PowerShell.PowerShellGet.UtilClasses.PSCredentialInfo ('PSUSecretStore', 'DevOpsPAT')
}
Register-PSResourceRepository @parameters
Cannot find type [Microsoft.PowerShell.PowerShellGet.UtilClasses.PSCredentialInfo]: verify that the assembly containing this type is loaded.
Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.