I need to get an inventory of VS Code extension in my enviromnent.
I was going down the road of using Extension Attribute.
I have this script created, and using Advnced Search to view the results.
This script is returning the value of “Not Installed” for devices where VS code is not installed.
Devices where VS Code do not report back any installed extensions.
This is the code I am using
#!/bin/bash
# Define the location of the Visual Studio Code executable.
VSCODE_APP_PATH="/Applications/Visual Studio Code.app"
# Check if VS Code is installed.
if [[ -d "$VSCODE_APP_PATH" ]]; then
# List all installed extensions and their versions.
# The output is piped to a series of commands to format it for readability in Jamf Pro.
EXTENSIONS_LIST=$(/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code --list-extensions | tr '\n' ',' | sed 's/,$//' | sed 's/,/, /g')
echo "<result>$EXTENSIONS_LIST</result>"
else
# If VS Code is not installed, report "Not Installed".
echo "<result>Not Installed</result>"
fi
exit 0
Once I compile the list I can then go and work on the approved extensions.
I am looking for some assistance on gathering the extensions. Thanks
