title: Parse GUID out of string
body: <p>I am running into an issue with this following using trim. It is removing some of the GUID. I would like to just get the GUID out of this. If anyone could help it would be appreciative.Thank you in advanced.</p>
  
  <pre><code>((Get-ADOrganizationalUnit -Filter {Name -eq "OUName"} -Properties LinkedGroupPolicyObjects,gplink) | ForEach-Object {if($_.GPlink){$_.GPlink.Split(",") | ForEach-Object {if($_ -like 'DC=DCNAME*'){if($_.length -gt 10){(((($_).trim('DC=DCNAME;0][LDAP://cn={')).trim('}')) ) }} }}}) 
  </code></pre>
  
  <p>My output is this:</p>
  
  <pre><code>754FF9F1-078A-4E05-913D-4F36572B2FC6
  EDDAAB18-2BA6-42E6-A5EC-21B0227BE71A
  7DF312DB-EB73-418E-8F64-3E391F4639B7
  6E3512-4100-48A3-9A65-4DA17A0E2D87
  72EF89D6-2C57-40AC-A116-2CAD89F453ED
  2][LDAP://cn={31BB7749-F6DC-4098-8F10-9D8B4B0F0C0A
  78528B0-F379-4E8F-A166-ACE1448AF9B2
  </code></pre>