$path="web\index.html"; $tag=(Get-Clipboard -Raw).Trim(); if ($tag -notmatch 'mitgo-verification') { throw "Clipboard does not contain the Mitgo verification tag" }; $full=(Resolve-Path $path); $html=[IO.File]::ReadAllText($full); if ($html -match 'mitgo-verification') { Write-Host "ALREADY ADDED" -ForegroundColor Yellow } else { $updated=[regex]::Replace($html,''," $tag`r`n",1); if ($updated -eq $html) { throw "Closing head tag was not found" }; [IO.File]::WriteAllText($full,$updated,[Text.UTF8Encoding]::new($false)); Write-Host "META TAG ADDED" -ForegroundColor Green }