$app = Get-SPWebApplication
New-SPAlternateURL -WebApplication $app -Zone "Intranet" -Url $app.Url
...
However, this is what I am getting:
New-SPAlternateURL : You must specify the default zone URL for all Web applications. To delete the Alternate URL Collection, remove the public URLs in all other zones, and then remove the default zone URL
It turns out this is the error message you get when you try to use the same URL for more than one zone. It would have been nice if the error message actually said that. So now my code is like this:
$app = Get-SPWebApplication
$intranetUrl = $app.Url
Set-SPAlternateURL -Identity $app.Url -Zone "Default" -Url $defaultUrl
New-SPAlternateURL -WebApplication $app -Zone "Intranet" -Url $intranetUrl