Bir makinede powershell ile PowershellGallery.com'dan bir modül kurmak istediğimde
Install-Module -Name PSWritePDF
şöyle bir hata alıyordum:
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the
provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the
specified package has the tags.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7468 char:21
+ ... $null = PackageManagement\Install-PackageProvider -Name $script:N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [I
nstall-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.Install
PackageProvider
PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider
name 'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7474 char:21
+ ... $null = PackageManagement\Import-PackageProvider -Name $script:Nu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportP
ackageProvider
WARNING: Network connectivity may not be available, unable to reach remote sources.
WARNING: Unable to bootstrap the required package provider due to problems with network connectivity. Please
fix your network connection. If this is not possible, refer to 'Get-Help Install-PackageProvider' or
https:/go.microsoft.com/fwlink/?LinkId=626941 for guidance on installing the package provider manually.
WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''. WARNING: Unable to download the list of available providers. Check your internet connection. PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try 'Get-PackageProvider -ListAvailable'. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7478 char:30 + ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-Pa
ckageProvider], Exception
+ FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlet
s.GetPackageProvider
Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that
'2.8.5.201' or newer version of NuGet provider is installed. At line:1 char:1 + Install-Module -Name PSWritePDF + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Install-Module], InvalidOperationException + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module
Çözüm olarak şu sitede gösterildiği gibi
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
ile TLS 1.2'yi Service Point Manager olarak ayarladıktan sonra asıl kurmak istediğim PSWritePDF'i kurmayı başardım.