Actualizar IISAdministration con Powershell.
Estoy intentando actualizar IISAdministrator en Windows Nano Server con Remote PowerShell.
Versión actual “1.0.0.0”, actualizar a versión “1.1.0.0”.
Install-Module -Name IISAdministration -verbose -force
El resultado es el siguiente:
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
He intentado agregar el parámetro SkipPublisherCheck y ha funcionado, pero al utilizar:
Import-Module IISAdministration
Obtengo el siguiente error:
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
He intentado instalar el paquete localmente con el comando:
Install-Package C:\Package\iisadministration.1.1.0.nupkg
Pero la instalación falla:
Install-Package : Package 'IISAdministration' failed to install.
+ CategoryInfo : InvalidResult: (IISAdministration:String) [Install-Package], Exception
+ FullyQualifiedErrorId : PackageFailedInstallOrDownload,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
¿Alguna solución? Ayúdeme, por favor.
davy.ai
Parece que hay un problema con la firma del módulo, lo que ocasiona que la instalación falle. Agregar el parámetro
SkipPublisherCheck
puede ser una solución temporal, pero no se recomienda ya que pasa por alto las verificaciones de seguridad para el módulo.Una posible solución es descargar manualmente el módulo desde PowerShell Gallery e instalarlo usando los parámetros
-Force
y-AllowClobber
. Aquí están los pasos:Copy-Item
).Instala el módulo en el Nano Server:
Si el error persiste, también puede intentar instalar la dependencia
Microsoft.Web.Administration
manualmente. Puede descargarlo de NuGet Gallery e instalarlo usando el cmdletInstall-Package
.Una vez que se instala la dependencia, intente importar el módulo
IISAdministration
nuevamente y vea si funciona.