#1 13 Dec 2011 04:08

Jimmy.Relay3r
Member
From: Sydney, Australia
Registered: 13 Dec 2011
Posts: 2
Website

VMware VIX - PowerShell, CMD and PHP

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

Offline

#2 15 Dec 2011 05:28

Jimmy.Relay3r
Member
From: Sydney, Australia
Registered: 13 Dec 2011
Posts: 2
Website

Re: VMware VIX - PowerShell, CMD and PHP

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

Offline

#3 27 Dec 2014 07:09

hanifkhan
New Member
Registered: 27 Dec 2014
Posts: 1

Re: VMware VIX - PowerShell, CMD and PHP

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.

Offline

Board footer

Powered by FluxBB