![](/img/trans.png)
[英]Is it possible to install both SQLPS and SqlServer PowerShell module on Windows 10?
[英]Cannot install SQLServer module in Powershell
我嘗試通過以管理員身份(win10,64Bit)執行以下命令來安裝 Powershell SQLSERVER 模塊,但它失敗了
PS C:\WINDOWS\system32> Install-Module -Name SqlServer
PackageManagement\Install-Package : No match was found for the specified search
criteria and module name 'SqlServer'.
Try Get-PSRepository to see all available registered module repositories.
At C:\Program
Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809
char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound:
(Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
ception
+ FullyQualifiedErrorId :
NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.
InstallPackage
我在網上搜索過,我嘗試了一些解決方案,我什至與公司管理員交談過,但沒有運氣。 正如他們告訴我的那樣,公司沒有代理,只有防火牆。 其他同事可以毫無問題地運行該命令。 下一個命令也失敗
PS C:\WINDOWS\system32> Get-PSrepository
WARNING: Unable to find module repositories.
任何的想法?
我遇到了這個。 我必須運行以下命令:
Register-PSRepository -Default
Register-PSRepository -Name PSGallery -InstallationPolicy Trusted -SourceLocation "https://www.powershellgallery.com/api/v2/" -Verbose
這出錯了。 然后我就可以跑了
Install-Module sqlserver
我的已修復啟用 tls 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.