Ported publish script from bash to powershell for windows deployment