我正在嘗試為 O365 租戶啟用現代身份驗證,然后說明說要匯入 Exchange Online Management 模塊。我沒有那個模塊,所以同樣的說明說使用安裝它
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.5
但是后來我收到了這個錯誤
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'.
PackageManagement\Install-Package : No match was found for the specified search criteria and module name
'ExchangeOnlineManagement'. Try Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21
... $null = PackageManagement\Install-Package @PSBoundParameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], E
ception
FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
以防萬一我也運行這個來檢查
Get-PSRepository
結果是
Name InstallationPolicy SourceLocation
---- ------------------ --------------
PSGallery Untrusted https://www.powershellgallery.com/api/v2
這似乎是正確的。所以有人知道為什么它不起作用。
謝謝!
uj5u.com熱心網友回復:
只需回答答案,以防它可以幫助將來偶然發現此問題的任何其他人。這是一個 TLS 問題,修復方法很簡單:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
之后,一切正常。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/367053.html
標籤:电源外壳
