stop-service MyPracticePluginService # Delete old Java files. Remove-Item 'C:\MyPracticePlugin\lib\medinet-remoting-2.0.jar' Remove-Item 'C:\MyPracticePlugin\lib\medinet-plugin-2.0.jar' # Copy new Java files. Ensure these files exist before running the script! Copy-Item 'C:\Myhealth FTP\FTP Inbox\medinet-remoting-2.0.jar' 'C:\MyPracticePlugin\lib\' Copy-Item 'C:\Myhealth FTP\FTP Inbox\medinet-plugin-2.0.jar' 'C:\MyPracticePlugin\lib\' # Wait 30 seconds before attempting to start MyPracticePluginService again, ensuring it has # enough time to shut down in the first place. The command to start it up may go ignored otherwise. Start-Sleep -Seconds 30 start-service MyPracticePluginService Start-Sleep -Seconds 15