Forum Discussion

Intuneme's avatar
Intuneme
Copper Contributor
May 15, 2024
Solved

Installing .Net 8.0 via Intune Using Winget

I am trying to get .NET 8.0 installed on user machines via a PowerShell script via Intune. I upload the following script. I have tested locally on a machine and works well, but fails when sending through Intune as a script. 

 

# Install .NET 8.0 using Winget
winget install --silent --exact Microsoft.DotNet.Runtime.8

 

The problem is that if winget has not been used before on new install of windows, you have to "accept" this agreement about region of PC. It fails at this point. I attached the photo of what I get.

I need to figure out what needs to be added to script to automatically accept the agreement for region and silently install .NET 8.0.

 

 

 

  • To automatically accept the agreements, you can add the and --accept-source-agreements and --accept-package-agreements parameters to your Winget command. So something like this:

     

    winget install --silent --exact --accept-source-agreements --accept-package-agreements Microsoft.DotNet.Runtime.8

     

    Please note that these parameters will only work if the agreements have not changed since they were last accepted—at least, that would make sense to me. If they have changed, you may still be prompted to accept them again.

     

    I hope this helps!

2 Replies

  • To automatically accept the agreements, you can add the and --accept-source-agreements and --accept-package-agreements parameters to your Winget command. So something like this:

     

    winget install --silent --exact --accept-source-agreements --accept-package-agreements Microsoft.DotNet.Runtime.8

     

    Please note that these parameters will only work if the agreements have not changed since they were last accepted—at least, that would make sense to me. If they have changed, you may still be prompted to accept them again.

     

    I hope this helps!

Resources