VMware Cloud Community
mikber
Contributor
Contributor

Run powershell script via batch redirect script not working after upgrade.

I have a problem running redirect batch script after upgrade to vsphere 5. Before upgrade (v.4u1) it worked fine.

I have a powershell script who is triggered on an alarm event via redirect script.

snip from redirect script

.

.

set POWERSHELL=C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -nologo -noprofile -noninteractive

start %POWERSHELL% -command "&"%1""

.

.

Action run a command "c:\foo\redirect.bat" "c:\bar\script.ps1" in alarm settings.

I know the vcenter is running the redirect script but the powershell script isn't called. If I however remove the batch "start" command the powershell script runs?

.

.

set POWERSHELL=C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -nologo -noprofile -noninteractive

%POWERSHELL% -command "&"%1""

.

.

This was not a problem before the upgrade. Anyone have a suggestion which might solve this problem? (I need the powershell script to run in another session)

//Micke

0 Kudos
2 Replies
RvdNieuwendijk
Leadership
Leadership

Moved this topic to the VMware vSphere PowerCLI community for better exposure.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
smertens
Contributor
Contributor

did anyone find a solution for this. I have the same problem after the upgrade to vsphere5.

Thanks in advance. 

0 Kudos