Azure Appcmd startup task, setting preloadEnabled for ALL sites

After a day of searching for it, I've finally got it. It basically uses a loop in appcmd by using the pipe to chain commands together (kinda like a for loop). Here it is:

%systemroot%\system32\inetsrv\AppCmd.exe list app /xml | %windir%\system32\inetsrv\appcmd set site /in -applicationDefaults.preloadEnabled:True

For IIS 8.5, to Set, the preload at the application level (not at Site Level) using appcmd, following command should be utilized.

appcmd set app "Default Web Site/ApplicationName" /preloadenabled:true