we need to run a simple powershell command on machines as they are provisioned, we have tried creating workflows to do this but its saying the powershell applets dont exist ?
Get-Disk we are using, surely this should be something that is simple to do but we cant get it to run successfully at all ?
prior to vra8 people were saying about using guest tools to do this but this doesnt seem to exist for vra 8 ? the documentation is quite lacking in direction on these things so any advise/help on this matter would be gratefully appreciated
Have you tried using the "Run program in guest" workflow? I think you can just specify the local path to powershell as the program and the script as arguments. I could try to come up with a simple example if needed, when I find the time.
How simple is your simple script?
I've been doing this with ABX actions and Invoke-VMScript.
Example: https://github.com/jbowdre/misc-scripts/blob/main/vRealize/configure_guest.ps1
i will give it a go and let you know, we jsut want to execute a command to install sql server etc
Hey, John!
Is it possible to get the vcenter address or fqdn from the vRA in the ABX code?
@EugeneZaytsev it seems like it should be but I wasn't able to find a way to do that short of passing it in as a custom property from the cloud template. I put together some notes on how I'm handling it here, in case you're interested.
Thanks, @johnbowdre!
I use subscriptions to run Powershell code to install applications, AD work post build. I have found ABX has some issues/limits with Powershell.
I have a Workflow that has several Actions that run Powershell scripts.
One of the custom properties in the subscription is vcUuid which I pass into a workflow which returns the "targetvcenterConnection" (See below), once I have the targetVcenterConnection I use that in my vRO Actions to connect to vCenter using normal PowerCLI.
Connect-VIServer $vcfqdn -User $vcUser -Password $vcPass -Force;
$vmname = "VMNAME";
$vm = Get-vm -name $vmname;
You can then check the Exit code
@hhc_rleefyiwow, that's cool. One thing I don't get - how do you move from inputProperties.customProperties.vcUuid in the payload to targetVcenterUuid in your workflow?