MacOS
View all Worklets
MacOSmacOS

macOS - Software - Install Microsoft VSCode

Deploy Visual Studio Code to macOS endpoints with the official universal binary from code.visualstudio.com

Worklet Details

What the Visual Studio Code deployment does

This Automox Worklet™ deploys Microsoft Visual Studio Code to macOS endpoints. The Worklet pulls the universal-binary ZIP from https://code.visualstudio.com/sha/download?build=stable&os=darwin-universal, unpacks it, and stages the application bundle at /Applications/Visual Studio Code.app. The evaluation phase is a simple presence check, so the Worklet is safe to run on a recurring policy across a mixed fleet of developer and non-developer laptops.

The remediation script uses curl with the -s -L flags to follow redirects from Microsoft's distribution CDN, writes the archive to /tmp/vscode.zip, and runs unzip -o -q to extract Visual Studio Code.app into /tmp. The script then moves the bundle into /Applications, removes the temporary archive and any leftover extraction directory, and reads the CFBundleShortVersionString from Info.plist so the installed version surfaces in the Automox activity log.

VS Code is a free, open-source code editor from Microsoft. The universal package is the same binary Microsoft ships from the marketing site, so the deployment matches what each developer would receive on a manual install. There is no licensing wrapper, no installer GUI, and no first-run prompts at the system level.

Why standardize Visual Studio Code across the fleet

VS Code is a common editor on macOS engineering teams. The manual install path produces three avoidable problems: developers run different versions, extensions and settings vary because the editor was installed at different points in the release stream, and new hires wait on tooling during onboarding. Standardizing the install through Automox addresses that gap. The Worklet drops the current stable build of Visual Studio Code into /Applications on day one, and a recurring evaluation catches any endpoint where the app has been removed by a user or by a reimage.

Apply this Worklet to the developer macOS endpoint group in the Automox console. The Worklet lands the current stable Visual Studio Code build in /Applications on every targeted endpoint, and each install is recorded in the Activity Log so IT Operations can audit and re-run the deployment without filing a ticket per developer.

How the Visual Studio Code deployment runs

  1. Evaluation phase: The Worklet checks whether /Applications/Visual Studio Code.app exists. If the bundle is present, the endpoint is marked compliant and no remediation runs. If the bundle is missing, the evaluation exits non-zero and Automox schedules the remediation phase. The check is intentionally narrow: it does not validate signature, version, or codesign state, so a manually installed VS Code on a developer laptop will not be overwritten by the Worklet.

  2. Remediation phase: The script downloads the darwin-universal stable ZIP from code.visualstudio.com using curl -s -L -o /tmp/vscode.zip, extracts it with unzip -o -q -d /tmp, moves Visual Studio Code.app from /tmp to /Applications with mv, then runs a cleanup step that removes /tmp/vscode.zip and any leftover extraction directory. If the download or move succeeds, the script reads the version string from /Applications/Visual Studio Code.app/Contents/Info.plist with defaults read … CFBundleShortVersionString and prints it to stdout. If /tmp/vscode.zip is missing after the curl call, or if the bundle is not present in /Applications after the move, the script writes a failure message to stderr and exits non-zero.

Visual Studio Code deployment requirements

  • macOS 10.15 (Catalina) or later – the current VS Code stable build no longer supports earlier macOS versions

  • Intel or Apple Silicon processor; the darwin-universal binary runs natively on both architectures without Rosetta translation

  • Outbound HTTPS reachability from the endpoint to update.code.visualstudio.com and the Microsoft download CDN (vscode.download.prss.microsoft.com)

  • Approximately 500 MB of free disk space on the system volume for the download, extraction, and installed bundle

  • The Automox agent runs as root on macOS, so no extra privilege escalation is required for the curl, unzip, and mv operations

  • /Applications writable by the agent context (true by default on managed macOS endpoints; MDM-locked configurations may require an exemption)

Expected endpoint state after the Visual Studio Code deployment

After a successful remediation, Visual Studio Code.app appears at /Applications/Visual Studio Code.app and the Automox activity log records the installed CFBundleShortVersionString. The next scheduled evaluation finds the bundle present and reports the endpoint as compliant without re-running remediation. Developers can launch the editor from Spotlight or the /Applications view in Finder, sign in for Settings Sync against a Microsoft or GitHub account, and install the extensions their team standardizes on.

Validate the install from a terminal session with mdls -name kMDItemVersion "/Applications/Visual Studio Code.app" or by running /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code --version, which prints the version, commit, and architecture. For fleet-level evidence, query Automox reporting for the Worklet's last-run status and exit code across all targeted macOS endpoints. To upgrade Visual Studio Code in place on a future cadence, schedule this same Worklet with a wrapper that first removes /Applications/Visual Studio Code.app, since the evaluation will then re-fire and pull the current stable build from Microsoft.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets