Error opening Console from VMware console.

Error opening Console from VMware console.

avatar

Every time I try fails. See the attached screnshoot.


Full text of the error:



The term 'ConvertTo-SecureString <password was here>' is not recognized as the nameof a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:2 char:53

+ $secpasswd = ConvertTo-SecureString '<password was here>' <<<< -AsPlainText -Force;

+ CategoryInfo : ObjectNotFound: (ConvertTo-SecureString <password was here>:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException


New-Object : Exception calling ".ctor" with "2" argument(s): "Cannot process argument because the value of argument "password" is null. Change the value of argument "password" to a non-null value."

At line:3 char:22

+ $mycreds = New-Object <<<< System.Management.Automation.PSCredential ("<My login>", $secpasswd);

+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand


Connect-VIServer : Cannot validate argument on parameter 'Credential'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.

At line:4 char:43

+ Connect-VIServer <My vCenter> -Credential <<<< $mycreds;

+ CategoryInfo : InvalidData: (:) [Connect-VIServer], ParameterBindingValidationException+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutom ation.ViCore.Cmdlets.Commands.ConnectVIServer

All Comments (2)

avatar

Hello,


ConvertTo-SecureString was added in powershell 3, what is installed on your computer?


I will update the documentation to highlight this as a requirement, I will also try to add a validation in our script.

Maurice

avatar

I miss to install PS 3.0... now fixed.


Thanks a lot!