Skip to content

Using ilorest with powershell doesn't allow securestrings in -p parameter #109

@ps-pinky

Description

@ps-pinky

Hey there,
maybe I'm a bit off the grid with my usecase in using ilorest, but it has pretty much helped me installing firmware like the spscontroller firmware, where the iLO kept telling me, that the Firmware image i downloaded for the server wouldn't be a appropiate firmware file using the HPEILOCMDlets, but this is an different story for a different issue I guess somewhere else...

My Problem, or issue here is, using the ilorest package in a Powershell script, that, if i ,for instance, use it like this

ilorest.exe flashfwpkg $fwpackage --url $serverip -u $username -p $password

is, that the -p parameter only allows passwords to be passed in clear text.
the way, i fill the password variable to be used in the line above, looks like this:

$password = Read-Host "Enter Password for User $username"

Which works pretty fine from this point and for my script, but knowing the password is written in clear text into the variable.

What I would do in Powershell would make it a bit more secure is writing the password to the variable as 'SecureString', using:

$password = Read-Host "Enter Password for User $username" -AsSecureString

ilorest then gives the following output:

iLORest : RESTful Interface Tool version 5.3.0.0
Copyright (c) 2014-2024 Hewlett Packard Enterprise Development LP
--------------------------------------------------------------------------------
ERROR   : Error 401. Login is unauthorized.
Please check the credentials/OTP entered.

Using the get-credential CMDLet in Powershell like this:

$password = Get-Credential -Message "Enter Password for $username" -UserName $username

leads to the same result given above.

So, my question is, is there the possibility, to support passwords in the powershell securestring/get-credential format, if you are using the -p parameter, or is that too much over the top, to implement?

Best Regards Pinky

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions