我正在尝试使用远程 powershell 更新 windows nano 服务器中的 IISAdministrator
当前版本“1.0.0.0”,更新到版本“1.1.0.0”
Install-Module -Name IISAdministration -verbose -force
然后结果如下
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='IISAdministration'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'IISAdministration'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'C:\tmp' and PackageManagementProvider is 'NuGet'.
VERBOSE: Total package yield:'0' for the specified package 'IISAdministration'.
VERBOSE: Performing the operation "Install-Module" on target "Version '1.1.0.0' of module 'IISAdministration'".
VERBOSE: The installation scope is specified to be 'AllUsers'.
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'IISAdministration' with version '1.1.0.0' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='IISAdministration'' for ''.
VERBOSE: InstallPackage' - name='IISAdministration', version='1.1.0.0',destination='C:\Users\Administrator\AppData\Local\Temp\1137679534'
VERBOSE: DownloadPackage' - name='IISAdministration', version='1.1.0.0',destination='C:\Users\Administrator\AppData\Local\Temp\1137679534\IISAdministration\IISAd
ministration.nupkg', uri='https://www.powershellgallery.com/api/v2/package/IISAdministration/1.1.0'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/IISAdministration/1.1.0'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/IISAdministration/1.1.0'.
VERBOSE: Completed downloading 'IISAdministration'.
VERBOSE: InstallPackageLocal' - name='IISAdministration', version='1.1.0.0',destination='C:\Users\Administrator\AppData\Local\Temp\1137679534'
VERBOSE: Found the catalog file 'IISAdministration.cat' in the module 'IISAdministration' contents.
VERBOSE: Valid authenticode signature found in the catalog file 'IISAdministration.cat' for the module 'IISAdministration'.
VERBOSE: Validating the 'IISAdministration' module files for catalog signing using the catalog file 'IISAdministration.cat'.
PackageManagement\Install-Package : The module 'IISAdministration' cannot be installed because the catalog signature in 'IISAdministration.cat' does not match
the hash generated from the module.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1661 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : InvalidCatalogSignature,ValidateAndGet-AuthenticodeSignature,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
我试过添加参数 SkipPublisherCheck 它是成功的,但是
Import-Module IISAdministration
我在下面出现错误
Could not load file or assembly 'Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.
+ CategoryInfo : NotSpecified: (:) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand
我尝试在本地安装包
Install-Package C:\Package\iisadministration.1.1.0.nupkg
但安装失败
Install-Package : Package 'IISAdministration' failed to install.
+ CategoryInfo : InvalidResult: (IISAdministration:String) [Install-Package], Exception
+ FullyQualifiedErrorId : PackageFailedInstallOrDownload,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
任何解决方案,帮助我。