VMware Cloud Community
philk33
Enthusiast
Enthusiast

Run Scripts in Guest (Guest Script Manager) keeps running on a loop...

Hello,

I'm trying to run a powershell script in the guest that uninstalls the App Volumes Agent. When I run it manually outside of my VDI workflow it will run successfully and uninstalls the agent. However when I run it inside of a larger workflow, it seems to run more than once and then produce this error which halts the workflow:

Workflow execution stack:

***

item: 'Run script in VM guest/item13', state: 'failed', business state: 'null', exception: 'The guest process 2720 was not found. (Workflow:Kill process in guest / Scriptable task (item1)#8)'

When I log into the machine it's clear that app volumes was uninstalled, but for some reason the script re-executed...I'm not sure why it's doing this.

Here is the powershell I'm trying to run:

$app = Get-WmiObject -Class Win32_Product | Where-Object {

    $_.Name -match "App Volumes Agent"

}

$app.Uninstall();

Restart-Computer;

To me the error indicates it's trying to uninstall appvolumes but appvolumes has been uninstalled.

Tags (1)
0 Kudos
2 Replies
parmarr
VMware Employee
VMware Employee

The error code is not sufficient to gather many details about the issue. However please go through a similar communities thread which might help to get an idea about work around for this issue.

https://communities.vmware.com/thread/462268

Sincerely, Rahul Parmar VMware Support Moderator
0 Kudos
philk33
Enthusiast
Enthusiast

Why would you even reply with that answer? It's honestly not helpful at all. I shouldn't have to tell the workflow to continue even if it failed. That's counter-intuitive to the whole process.

What do you want, verbose/debugging logging from the powershell script?

0 Kudos