ME Patch Manager - Custom Scripts - Deployment policy's

ME Patch Manager - Custom Scripts - Deployment policy's

I'm new to this forum. I need to shutdown a server services in a certain order.
I'm looking for Powershell to add into the deployment script section. 

Stop-Service ServiceA
do { Start-Sleep -Milliseconds 200}
until ((get-service ServiceA).status -eq 'Stopped')
Stop-Service Serviceb
do { Start-Sleep -Milliseconds 200}
until ((get-service ServiceA).status -eq 'Stopped')
shutdown /r /t 5
Would this work with ME deployment policies? Do i need to specify anything else?

Thanks

                New to ADSelfService Plus?