VMware VIX - PowerShell, CMD and PHP

Microsoft Windows
Post Reply
User avatar
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Contact:

VMware VIX - PowerShell, CMD and PHP

Post by MigrationUser »

13 Dec 2011 04:08
Jimmy.Relay3r


Hi Guys,

first time posting I'm just having some issues with executing x64 compiled (.exe) powershell scripts from a legacy x86 command that is within VMware VIX sdk.

Basically my php form creates the xml, powershell reads the xml and then invokes a command with parameters through vmware vsphere and onto the VM.

The problem is vmware vix does not let me use the 'invokevmscript' cmdlet in x64 powershell - and windows won't let me use import-module servermanager and Add-windowsfeature in x86 mode.

Any ideas?

Thanks

Jimmy

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

#15 Dec 2011 05:28
Jimmy.Relay3r


solved

The problem, in-case anybody has future problems when going between x86 and x64 versions of powershell.

Don't compile your x64 powershell, run it as a .ps1 file and call "C:\windows\system32\windows power shell\v1.0\powershell.exe" with -file and then the directory of your script e.g. "C:\temp\myscript.ps1"

This will change the executable which for x86 is running in the SysWOW64 directory to run the x64 version of powershell, thus giving you the servermanager and other modules you'd normally expect.

"Invoke-VMscript" from vmware does not run in x64 powershell - At least at the moment

Hope this helps anybody in the future

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

#27 Dec 2014 07:09
hanifkhan


I'm just having some issues with executing x64 compiled (.exe) powershell scripts from a legacy x86 command that is within VMware VIX sdk.
Basically my php form creates the xml, powershell reads the xml and then invokes a command with parameters through vmware vsphere and onto the VM.
Post Reply