Hello,
I'm currently running vRO/vRA 7.3.1. I've created a blueprint in vRA which has been nice, but I'd like to do more with it. I have some PowerShell scripts that I'd like to setup as a workflow in vRO and then have them as a blueprint somehow in vRA (if possible) so anybody on my team or in the company if needed could just click and run a script. I have created a PowerShell machine (2k12 R2) that has PowerShell 5.1 on it. I've run the New-VICredentialStoreItem on there for a particular vCenter to test with. Below is the code I'm using for the script:
$creds = Get-VICredentialStoreItem -File C:\vicredentials.xml
Connect-VIServer -Server $creds.Host -User $creds.User -Password $creds.Password
$log = Read-Host "Enter log name i.e. VRM.txt"
$GetVM = Get-VM -location VRM | sort Name
$GuestCredential = Get-Credential #Provide Guest OS credentials
$obj = foreach ($vm in $GetVM)
{
$string = "query user /server:$vm"
Invoke-VMScript -vm $vm -ScriptText $string -ScriptType Powershell -GuestCredential $GuestCredential | Format-List | Out-File $log -append
Basically I'd like to setup a workflow somehow to just list the particular vCenter this would apply to, then ask the user for the name of the log file they want and then have it pass that into the script. They would also pass the credentials for the machines (a service account, or maybe that's in the workflow, but hidden somehow). The script would run and somehow (I'm not sure if this is possible in vRO/vRA) the file is created and the user can access it somehow after vRA has completed it.. Perhaps I create a share they can get to that the script puts it there. I tried looking around on google for this, but whatever I tried really didn't work, so I'm stuck. I'm not sure if this is possible or not, but since this is the simplest script I have I want to try it first before moving onto ones that require more input from the user. Any help is appreciated.
Thanks