You can retrieve existing tags defined in vSphere and save a specific tag into a variable.

Verify that you are connected to a vCenter Server system.

1

Get the tag named MyTag.

Get-Tag -Name 'MyTag'
2

Save the tag into a variable.

$tag = Get-Tag -Name 'MyTag'