Hi ,

I have an playbook for Vmware Powercli :

tasks:
  - name: Run PowerShellGet VM script
    command: pwsh /tmp/vcsa_getVM.ps1
    ignore_errors: yes
    changed_when: false
    register: powershell_output_getVM

  - name: Debug GetVM output
    debug:
      msg:
       - "{{ powershell_output_getVM.stdout_lines }}"

Out put:

TASK [Debug GetVM output] 
********************************************************************************************************************************************
ok: [localhost] => {
    "msg": [
        [
            "", 
            "Name                 PowerState Num CPUs MemoryGB", 
            "----                 ---------- -------- --------", 
            "BVI12DS2             PoweredOn  4        4.000", 
            "BVI13PL1             PoweredOn  8        16.000", 
            "BVI06ID1             PoweredOn  4        4.000", 
            "BVI14PL1             PoweredOn  8        16.000", 
            "BVI10VA1             PoweredOn  4        4.000", 
            "BVI13CS1             PoweredOn  4        8.000", 

I want my o/p should only be list of the following: 
             BVI12DS2             
             BVI13PL1             
            BVI06ID1            
            BVI14PL1              
            BVI10VA1             
            BVI13CS1  

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2e82c5d8-b81e-4118-b9ce-f681afb6ae05%40googlegroups.com.

Reply via email to