I got this error "Publish-PSArtifactUtility : Failed to publish script 'test': 'nuget.exe failed to push Method not found" when publishing a new script to PowerShell Gallery
Publish-Script -Path D:\publish\test.ps1 -Repository PSGallery -NuGetApiKey o
Publish-PSArtifactUtility : Failed to publish script 'test': 'nuget.exe failed to push Method not
found: 'System.Security.Cryptography.X509Certificates.X509CertificateCollection
System.Net.Http.HttpClientHandler.get_ClientCertificates()'.
'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:11338 char:17
+ ... Publish-PSArtifactUtility @PublishPSArtifactUtility_Param ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : FailedToPublishTheScript,Publish-PSArtifactUtility
PS C:\Users\Administrator>
I have already run this command to upgrade TLS protocol to TLS 1.2 but it still not working!
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12