title: Cannot print the results if the Get-EC2Tag command is under variable
body: <p>$instanceId = (New-Object System.Net.WebClient).DownloadString(&quot; <a href="http://169.254.169.254/latest/meta-data/instance-id%22" rel="nofollow noreferrer">http://169.254.169.254/latest/meta-data/instance-id&quot;</a>)</p>
  <p>$tag = Get-EC2Tag -Filter @{Name=&quot;resource-type&quot;;Value=&quot;instance&quot;},@{Name=&quot;key&quot;;Value=&quot;Name&quot;} | Where-Object ResourceId -eq $instanceId | Select-Object Value | Format-Table -HideTableHeaders
  Write-Host $tag</p>