Autor Tópico: Problemas para executar script Powershell  (Lida 1711 vezes)

Offline diegonetto

  • Usuário Ubuntu
  • *
  • Mensagens: 1
    • Ver perfil
Problemas para executar script Powershell
« Online: 18 de Julho de 2018, 18:44 »
Boa noite.

Recentemente instalei o Powershell no meu ubuntu 16.04, mas estou enfrentando problemas para executar um script.

O script serve para atualizar a firmware de uma lista de servidores, mas ele da erro no import do 'Posh-SSH' . Segue erro:

Import-Module : The specified module 'Posh-SSH' was not loaded because no valid module file was found in any module directory.
At /home/diego/Documentos/teste/python-ilorest-library-master/examples/Redfish/UpgradiLO/Update-ILO-Firmware(POSH).ps1:2 char:1
+ Import-Module -Name Posh-SSH
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Posh-SSH:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
 

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
User:


Até ai, tudo bem.

Entendo que preciso fazer a instalação do módulo.  Porém, quando vou instalar, utilizando o comando " Install-Module -Name Posh-SSH  " da o seguinte erro:


PackageManagement\Install-Package : Could not compare "6.0.0-alpha" to "5.0". Error: "Cannot convert value "5.0" to type      "System.Management.Automation.SemanticVersion". Error: "Cannot process argument because the value of argument "version" is not     valid. Change the value of the "version" argument and run the operation again.""                                                   At /opt/microsoft/powershell/6.0.0-alpha.9/Modules/PowerShellGet/PSModule.psm1:1706 char:21oooooooooooooooooooooooooooooooooooooo] + ...          $null = PackageManagement\Install-Package @PSBoundParameters                                                        +                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : ComparisonFailure,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage


O que eu faço?