If you want to remove “” via ansible , thats possible

On Thu, 14 Nov 2019 at 18:53, Rakesh Parida <[email protected]>
wrote:

> Here is my script whcih i am using:
>
> Connect-VIServer -Server x.x.x.x  -User:xxxxx.com\yyyy -Password:zzzz |
> Out-Null
> $result = Get-VM -Name BV* |Where-object {$_.powerstate -eq "poweredon"} |
> Select-Object -ExpandProperty Name
> $result
>
>
>
> On Thursday, November 14, 2019 at 6:47:31 PM UTC+5:30, Rakesh Parida wrote:
>>
>> Hi Jordan ,
>>
>> Thanks for your suggestion .
>>
>> It worked for some extent , now  iam getting the o/p as below.  Actually
>> i am new to PowerCLI so dont have much idea on PowerCLi cmdlets, But is
>> there a way to remove the inverted commas and Comma using the PowerCLi
>> Commad.
>> "BVI12DS2",
>>             "BVI13PL1",
>>             "BVI06ID1",
>>             "BVI14PL1",
>>             "BVI10VA1",
>>             "BVI13CS1",
>>             "BVI03CA1",
>>             "BVI13SC2",
>>             "BVI12DB2",
>>             "BVI05CS2",
>>             "BVI04OR2",
>>
>>
>> Is there a way to remove the Special charecters using the command input.
>>
>> On Thursday, November 14, 2019 at 1:44:39 AM UTC+5:30, Jordan Borean
>> wrote:
>>>
>>> You could use something like grep to extract it but you could also add
>>> the following in your powershell script
>>>
>>> | Select-Object -ExpandProperty Name
>>>
>>> This must come after your Get-* cmdlet call, i.e. 'Get-VMs |
>>> Select-Object -ExpandProperty Name'. This works by taking in the output
>>> from the cmdlet and outputting only the values of the Name property.
>>>
>>> Thanks
>>>
>>> Jordan
>>>
>> --
> 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/6b6794ad-28d5-4373-8811-f5864b7a8d74%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/6b6794ad-28d5-4373-8811-f5864b7a8d74%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CALJDb0n0ONnteNLZsRpYZ30Wv94eSLN%2BLB1%3D1Dien1zbCbSEQg%40mail.gmail.com.

Reply via email to