I cannot find related native functions Get-WUInstall and Get-WURebootStatus that calls in UpdateAndSysprep.ps1. Did you declared in other script?
$Host.UI.RawUI.WindowTitle = "Installing updates..."
Get-WUInstall -AcceptAll -IgnoreReboot
if (Get-WURebootStatus -Silent)
{
$Host.UI.RawUI.WindowTitle = "Updates installation finished. Rebooting."
shutdown /r /t 0
}