Just putting this out to share since deploying software via Jamf apps have been very flakey for me lately. I am by no means a scripting expert so feel free to make changes or offer any refinement, so far it does what I want it to do, downloads the universal zip file for VS Code, Unzips it, moves it to Applications, trusts the app, and then deletes the install folder for the secure temp folder.
#!/bin/sh
pkgfile="VSCode-darwin-universal.zip"
tmpDir=$(/usr/bin/mktemp -d "/tmp/VSCode-install.XXXXXX")
logfile="/Library/Logs/VSCodeInstallScript.log"
url='
https://code.visualstudio.com/sha/download?build=stable&os=darwin-universal'
/bin/echo "--" >> ${logfile}
/bin/echo "`date`: Downloading latest version." >> ${logfile}
/usr/bin/curl -L -o ${tmpDir}/${pkgfile} ${url}
/bin/echo "`date`: Installing..." >> ${logfile}
cd ${tmpDir}
tar xvfz VSCode-darwin-universal.zip
/bin/sleep 5
mv "${tmpDir}/Visual Studio Code.app" "/Applications/Visual Studio Code.app"
/bin/echo "`date`: Deleting package installer." >> ${logfile}
rm -rf "${tmpDir}"
#Bless VS Code
xattr -rc "/Applications/Visual Studio Code.app"
exit 0