I am running version 2020.3.23.0 and have read the current topics. I am trying to setup powershell sessions that pull in my current modules and then connect to a vcenter. I would then be able to have an interactive session to do anything on that vcenter via powercli. basically a shortcut to powercli versus manually connecting each time.
I have down a powershell session and told it to import modules but that still doesn't work.
Hello,
Do you get a specific error message?
If so, could you please share it to understand what is happening on your end?
Best regards,
Érica Poirier
Here is the shell when I try to find or import modules.
Hello,
Thank you for the error message. It seems that the context of the PowerShell cannot access any modules.
Could you please send me a screen capture of your PowerShell entry? I want to test the same configuration in our environment and try to reproduce that behaviour.
Best regards,
Érica Poirier
Is this what you are looking for?
Hello,
Thank you for the screen capture.
Sadly that method will run the PowerShell commands locally on your machine and not on the remote machine.
You can instead use the PowerShell Remote Console entry if your goal is to run PowerShell commands on a remote computer. Here is a sample of the After open - Macro feature you can use with this entry type.
Let me know if that helps to achieve your goal.
Best regards,
Érica Poirier
My goal isn't to run commands on a remote machine. My goal is to open a powercli session on the machine that I have RDM on and have it auto connect to the vcenter via powercli when I open it.
Hello,
Thank you for that information and sorry that I've missed that point.
Is the screen capture you have provided taken from a PowerShell entry?
Could you please try to create a PowerShell entry and set the Command like the following?
Best regards,
Érica Poirier
if i change the session to run in 64-bit the modules are already installed. The question then is how do i grab the name of the session to put into the command for connection and passthru the username/password of the current session for auth?
Hello,
in a PowerShell session you can use the Embedded Script to set up the login and some additional commands.
For the login
Connect-VIServer $HOST$ -User $USERNAME$ -Password $PASSWORD$
where
$HOST$ = Host field from the PowerShell session
$USERNAME$ = Username from the PowerShell session (or from a linked Credential entry)
$PASSWORD$ = Password from the PowerShell session (or from a linked Credential entry)
If you want to link the PowerShell session to a credential entry, please make sure that the option "Allow password variable" is enabled (Security Settings in the PowerShell and Credential entry)
More information about you'll find here.
Regards,
Min