Automation

 View Only
  • 1.  Powershell 7.4.5 and Powercli 13.3

    Posted 27 days ago

    Hi,

    The last years we run our PowerCLI Scripts on a Windows Servcer 2016 with Powershell 5. Now we changed to Server 2022, Powershell 7.4.5 und PowerCLI 13.3.

    Since that change no of the Scripts works. It seems there is a problem with credentials.

    I saved the login credentials with Get-Credentials and Export-CLIxml and import them with Import-CLIxml

    Trying to import the *.cred File, i got this:

    Import-Clixml : Key not valid for use in specified state.
    At D:\aaaaaaa\bbbbbbb\cccccccc\searchSnap_newXXXX.ps1:16 char:15
    + $credential = Import-Clixml X:\yyyyyy\zzzzzzz\xy.cred
    +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Clixml], CryptographicException
        + FullyQualifiedErrorId : System.Security.Cryptography.CryptographicException,Microsoft.PowerShell.Commands.ImportClixmlCommand

    Also when trying to create a new credential file, the file ist emtpy:

    <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
      <S>1</S>
    </Objs>

    How can i fix this problems?

    Thanks

    Andi



  • 2.  RE: Powershell 7.4.5 and Powercli 13.3
    Best Answer

    Posted 26 days ago

    Did you recreate the .cred files under the new PS version?



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 3.  RE: Powershell 7.4.5 and Powercli 13.3

    Posted 26 days ago

    Hi Luc,

    Thank's so much. This was the problem.

    Best regards

    Andi