I'm using PowerShell as my shell with iTerm2 on macOS.
I know it's possible on bash and zsh but running the recommended solution doesn't work in powershell, because the ANSI escape doesn't work:
PS ~> echo -ne "\033]1;Title\007"
-ne
\033]1;Title\007
PS ~>
It should be possible to shell out to i.e. zsh from powershell to use these ANSI escapes, but I'd like a PowerShell-native solution.