Prompt Title: Deploy VS2022 with Intune

Created 1 year ago
Votes 0
Views 436 times
0
Human: how to deploy visual studio community 2022 on intunes using powershell step by step
ChatGPT:

To deploy Visual Studio Community 2022 on Intune using PowerShell, you will need to follow these steps:

  1. Download the Visual Studio installer: Download the Visual Studio Community 2022 installer executable file (vs_community.exe) from the official Microsoft website. Save the file to a known location on your computer.

  2. Create a configuration file: Create a JSON configuration file to specify the installation options for Visual Studio Community 2022. You can create a file named "config.json" and include the following content:

json
{ "channelUri": "https://aka.ms/vs/17/release/channel", "installChannelUri": "https://aka.ms/vs/17/release/install", "productId": "Microsoft.VisualStudio.Product.Community", "nickname": "Community", "add": [ "Microsoft.VisualStudio.Workload.NetWeb" ], "quiet": true, "norestart": true }

Feel free to modify the "add" section to include the workloads you need. The example above includes the ".NET Web Development" workload. You can find the list of available workloads in the Visual Studio 2022 workload and component IDs documentation.

  1. Upload the installer and configuration file to a file storage: Upload both the "vs_community.exe" and "config.json" files to a file storage accessible by your Intune devices. For example, you can use Azure Blob Storage or another cloud storage service of your choice.

  2. Create the PowerShell script: Create a PowerShell script that will download the installer and configuration file and then install Visual Studio Community 2022. Name it "Install-VSCommunity2022.ps1" and include the following content:

powershell
$installerUrl = "https://your-storage-service-url/vs_community.exe" $configUrl = "https://your-storage-service-url/config.json" $installerPath = "$env:TEMP\vs_community.exe" $configPath = "$env:TEMP\config.json" # Download the installer and configuration file Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath Invoke-WebRequest -Uri $configUrl -OutFile $configPath # Install Visual Studio Community 2022 Start-Process -FilePath $installerPath -ArgumentList "--config $configPath" -Wait -NoNewWindow

Replace "https://your-storage-service-url/" with the actual URL to your file storage where you uploaded the "vs_community.exe" and "config.json" files.

  1. Create a new Intune app: Log in to the Microsoft Endpoint Manager admin center (https://endpoint.microsoft.com/), and create a new "Windows app (Win32)" under "Apps > All apps > Add".

  2. Upload the PowerShell script: On the "App information" page, provide the necessary details for your Visual Studio Community 2022 app. On the "Program" page, under "Install command," enter:

mathematica
powershell.exe -ExecutionPolicy Bypass -File Install-VSCommunity2022.ps1

Under "Uninstall command," enter:

scss
%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vs_installer.exe uninstall --productId Microsoft.VisualStudio.Product.Community --quiet --norestart
  1. Configure detection rules: Set up a detection rule to check for the existence of the Visual Studio installation folder. Choose "Manually configure detection rules" and create a rule with the following settings:
  • Rule type: File
  • Path: %ProgramFiles(x86)%\Microsoft Visual Studio\2022\Community
  • File or folder: Common7
  • Detection method: File or folder exists
  1. Assign the app: Assign the app to the desired user or device groups in your organization
avatar
test
Shared 19 prompts
Created 1 year ago

Leave a Comment