VMware Cloud Community
collayder
Contributor
Contributor
Jump to solution

Passing characters to the guest system at startup VM

Hello friends. Tell me how to transfer certain characters to the guest machine (windows 7, 2008R2) using POWERCLI ?, When starting it, it asks to enter an encryption key. Here it is and pass the guest machine from the script.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You can use WIlliam's function in his Automating VM keystrokes using the vSphere API & PowerCLI post


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

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

You can use WIlliam's function in his Automating VM keystrokes using the vSphere API & PowerCLI post


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

0 Kudos
LucD
Leadership
Leadership
Jump to solution

One additional remark, you have to make sure that the VMware Tools are installed and running.
The best way to test if the guest OS is ready to receive keystrokes is by looking at the

Get-VM |

Select Name, @{N = 'Ready'; E = { $_.ExtensionData.Guest.GuestOperationsReady } }


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

0 Kudos
collayder
Contributor
Contributor
Jump to solution

I have installed vCenter 6.5, PowerCLI 11.2, but the cmdlet
Set-VMKeystrokes does not work. Tell me, please, what to do.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You will have to dot-source the function before the PS engine knows about it.

One way of doing that, copy the code of the function into a file with a .ps1 extension.
Let's assume the file is named Set-VMKeystrokes.ps1, and the file is stored in the directory into which you are currently located.

Then from your PS prompt, do

. .\Set-VMKeystrokes.ps1

Note the blank between the 2 dots!
Once done you can now call the function Set-VMKeystrokes.


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

0 Kudos