I found that using the “get-azurermwebapp” is dodgy, whereby the default list it returns is NOT a powershell object.

Anyways, if you need to batch swap-slots, here is how:

  
$sites = get-azurermwebapp -resourcegroup <RG>
  
foreach ($site in $sites)
     
{write-host "swapping slot on" $site.sitename
      
switch-azurermwebappslot -sourceslotname "staging" -destinationslotname "production" -name $site.Sitename -resourcegroup <RG> -swapwithpreviewaction "completeslotswap"
     
}
  

As usual, run with “-whatif” first etc.