尝试使用Powershell安装Sysinternals时的警告



我试图用powershell安装sysinternals包,但却收到了大量警告。需要注意的是,我遵循的是一套说明,对这个主题还不太了解。以下是尝试运行安装包命令时的警告:

Install-Package sysinternals
WARNING: NuGet: System.InvalidOperationException: Unable to find version '1.3.5.1' of package 'chocolatey-core.extension'.
WARNING: NuGet:    at NuGet.PackageRepositoryHelper.ResolvePackage(IPackageRepository sourceRepository, IPackageRepository
localRepository, IPackageConstraintProvider constraintProvider, String packageId, SemanticVersion version, Boolean
allowPrereleaseVersions)
WARNING: NuGet:    at NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version, Boolean ignoreDependencies,
Boolean allowPrereleaseVersions)
WARNING: NuGet:    at NuGet.Commands.InstallCommand.InstallPackage(IFileSystem fileSystem, String packageId, SemanticVersion version)
WARNING: NuGet:    at NuGet.Program.Main(String[] args)
WARNING: NuGet: System.InvalidOperationException: Unable to find version '2019.12.19' of package 'sysinternals'.

至于我之前所做的,我只安装了Chocolatey软件包提供商和更新了windows,但也许我做错了什么?以下是实现这一目标的步骤:

Set-ExecutionPolicy RemoteSigned
Install-PackageProvider Chocolatey
Install-Module -Name PSWindowsUpdate
Get-WUInstall -Verbose
Get-WUInstall -Install

非常感谢您的帮助。

虽然您可以使用Chocolatey和NuGet,但PowerShell的包管理器是PowerShellGet(好吧,它设计使用NuGet(。因此,Choco并不是真正需要的,但许多人仍然安装它并将其用于其他来源。

如果您直接使用PowerShellGet,您将看到相同的错误。

Find-Module -Name 'SysInternals' -AllVersions | 
Format-Table -AutoSize
<#
# Results
PackageManagementFind-Package : No match was found for the specified search criteria and module name 'SysInternals'. Try Get-PSRepository to see all available registered module 
repositories.
At C:UsersDanielDocumentsWindowsPowerShellModulesPowerShellGet2.2.3PSModule.psm1:8873 char:9
+         PackageManagementFind-Package @PSBoundParameters | Microsoft ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
#>
Find-Package -Name 'SysInternals' -AllVersions | 
Format-Table -AutoSize
<#
# Results
Find-Package : No match was found for the specified search criteria and package name 'SysInternals'. Try Get-PackageSource to see all available registered package sources.
At line:1 char:1
+ Find-Package -Name 'SysInternals' -AllVersions |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
#>

然而,如果你进行通配符搜索。。。

Find-Module -Name '*Internals*' |
Format-Table -AutoSize
<#
# Results
Version Name          Repository Description                                                                                                                                               
------- ----          ---------- -----------                                                                                                                                               
1.0.34  PoshInternals PSGallery  Collection of system internals tools for PowerShell.                                                                                                      
4.3     DSInternals   PSGallery  The DSInternals PowerShell Module exposes several internal features of Active Directory and Azure Active Directory. These include FIDO2 and NGC key aud...
0.2.8   AADInternals  PSGallery  The AADInternals PowerShell Module utilises several internal features of Azure Active Directory, Office 365, and related admin tools. DISCLAIMER: Funct...
0.1     LCMInternals  PSGallery  Demo scripts explaining the internals of LCM  
#>
Find-Package -Name '*Internals*' | 
Format-Table -AutoSize
<#
# Results
Name                                    Version Source    Summary                                                                                                                          
----                                    ------- ------    -------                                                                                                                          
PoshInternals                           1.0.34  PSGallery Collection of system internals tools for PowerShell.                                                                             
DSInternals                             4.3     PSGallery The DSInternals PowerShell Module exposes several internal features of Active Directory and Azure Active Directory. These incl...
AADInternals                            0.2.8   PSGallery The AADInternals PowerShell Module utilises several internal features of Azure Active Directory, Office 365, and related admin...
LCMInternals                            0.1     PSGallery Demo scripts explaining the internals of LCM                                                                                     
SilverlightToolkit-Internals-Unofficial 1.0.0   nuget.org The missing part of Microsoft Silverlight Toolkit. The internals DLL. 'System.Windows.Controls.Toolkit.Internals'                
AppInternals.Agent.Cloud.Support        10.10.0 nuget.org Configure an Azure Cloud Service solution for AppInternals application performance monitoring.                                   
InternalsVisibleTo.MSBuild              1.0.3   nuget.org Enables declaring 'InternalsVisibleTo' items in a .NET project file, rather than declaring them to an AssemblyInfo.cs file.      
Akrual.DDD.Utils.Internals              1.0.8   nuget.org Useful Classes yo use everywhere                                                                                                 
Meziantou.MSBuild.InternalsVisibleTo    1.0.1   nuget.org Allow to declare 'InternalsVisibleTo' in the csproj file, rather than declaring them to an AssemblyInfo.cs file.                 
microServiceBus.InternalService         1.0.0   nuget.org This package creates a stub from which you can create an Internal Service for microServiceBus.com   
#>

因此,正如您所看到的,没有这样一个名为SysInternal的模块/包可以安装。

您所做的只是从这里下载zip文件,然后解压缩并正常使用它。

Sysinternals套件https://learn.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite

我遇到了同样的问题,发现这里的答案很有用。似乎是TLS 1.3引起了这个问题,答案的第二部分——更改.Net Framework默认的TLS版本——允许我通过PowerShell完成系统内部安装。然后我删除了我创建的新注册表项。我想我将不得不等待,看看这是否是再次出现的事情,因为我继续学习更多,并在PS中进行更多的包管理工作。

最新更新