SharePoint: Update Content Type Hub Url in Managed Meta Data Service using PowerShell

One of the tasks during my migration project was to migrate SharePoint 2010 Managed Metadata service database to SharePoint 2013 in order to use it in SharePoint 2013. The service application was using content type hub. So, I performed the database backup and restored it on SP 2013 SQL Server. I ran the following PowerShell commands to create the new Managed Metadata Service and to use the restored DB in it.
$applicationPool = Get-SPServiceApplicationPool -Identity 'AppServiceAppPool'
$mms = New-SPMetadataServiceApplication -Name 'Managed Metadata Service Application' -ApplicationPool $applicationPool -DatabaseName ManagedMetadataServiceDB
New-SPMetadataServiceApplicationProxy -Name 'ProxyName' -ServiceApplication $mms -DefaultProxyGroup
After the service was successfully provisioned I opened it and as expected the content type hub url still referred to prevoius site collection from SharePoint 2010 farm.
As can be seen there is no way to edit it from the UI. So following PowerShell command is needed to update the content type hub url:
Set-SPMetadataServiceApplication -Identity "Managed Metadata Service Application" -HubURI "http://sp2013demo:88/contenttypehub"
  
profile for Nadeem Yousuf at SharePoint Stack Exchange, Q&A for SharePoint enthusiasts

+