I have a regular expression which will give the computername, cluster name & OSinfo
Get-QADComputer | ? {$.osname -match "2008" -and $.computername -match "hv"} |
Select @{Name="ComputerName";Expression={$_.computername.replace("$","")}}
,@{Name="ClusterName";Expression={$.computername.replace("$","");$.computername.replace("n[0-9][0-9]","")}},@{Name="OperatingSystem";Expression={$_.osname}}
Now the problem im facing is in extracting the clustername, for example if output of computer name is ADFCGS1N01$, i wanted the cluster name to look like ADFCGSN1, i wanted to remove all the characters after N to get cluster name,
Can some one please help me with the same