Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 180329

Split string until the end

$
0
0

Hi all,

I have the below code to get the alarm de finitions that are enabled and I want to split the name/string from the second empty space until the end:

 

 

   Get-AlarmDefinition | where-Object {$_.Enabled -eq 'True'} | Select-Object name,        @{N="Short Name";E={ $_.Name.Split('')[2]}} |         Export-Csv $outfile -NoTypeInformation -UseCulture

 

 

The alarms are for example:

Type:3 Team:Ops Virtual machine reboot or shut down (IP:192.168.0.1)

 

but I'm getting just:

Virtual

 

 

How can I split from the second empty space until the end of the string to get it like:

 

Virtual machine reboot or shut down (IP:192.168.0.1)

 

 

Thanks.


Viewing all articles
Browse latest Browse all 180329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>