Forum Discussion
rmerritt
Jan 15, 2026Copper Contributor
extract a string from this @{Name=WEBHOST001-OI3w}
Hi All I just want to be able to get the value WEBHOST001-OI3w from @{Name=WEBHOST001-OI3w} the variable storing it is called $vcentername
Charlie34000
Jun 08, 2026MCT
You're seeing this output because $vcentername is not an object with a Name property — it's a string that only looks like @{Name=...}. That's why $vcentername.Name returns nothing.
If the value is literally:
$vcentername = '@{Name=WEBHOST001-OI3w}';
then $vcentername is just a plain string:
@{Name=WEBHOST001-OI3w}
You can extract the actual name like this:
($vcentername.Split("=")[1]).TrimEnd("}")
which returns:
WEBHOST001-OI3w
To help you get the cleanest solution, could you show the command that produces $vcentername?
If the source returns a real object, you won’t need to parse anything.