Updated code for the user-data powershell script