For a powershell script that can update your Microsoft SQL Server, please refer to SQL Server Update Powershell