1

I'm trying to get this to work

Install-WindowsFeature NET-Framework-Core -source \\unc\blah\software\

I'm specifying a path that directly contains dotnetfx35.exe and I've tried specifying the path to the file and to the containing folder but neither works. I suspect there is some kind of folder structure I need to put in place but I can't find any documentation. This might be better on Server Fault but since I'm trying to install a framework using code I thought I'd try here first

2 Answers 2

2

You can't give it an installer .exe file; that's not how this cmdlet works. It's looking for files in the side by side (SxS) of the local computer first. The path you give it has to be to a similar SxS store. You can also mount a WIM and point it at that.

From Install-WindowsFeature on MSDN:

-Source<String[]>
Specifies the path to feature files, if the files are not available in the local feature store of the target computer or VHD. Valid values for this parameter are either a network path or the path to a Windows image file (WIM). If you are installing roles or features on an offline VHD, you must use a mounted WIM. It is not necessary to mount the WIM file for installing on a running physical computer, because a WIM is mounted internally for deployments to a physical computer. Specify the path by using a local relative path, or by using built-in environment variables that are prefixed with the $env tag as shown in the following examples.

The path specified in this parameter is only used if the command cannot find feature files in the local side-by-side store of the specified target computer or VHD. The command searches for feature files in the following order:

1) On the target computer or offline VHD.
2) Path specified as the value of this parameter. If you add a UNC path, verify that the computer account of the target server has Read permissions on the share. The computer account should be in one of the following formats: DOMAIN\SERVERNAME$ or SERVER$
3) Repository path specified by the Group Policy Object (GPO), Specify settings for optional component installation and component repair, located in Computer Configuration/Administrative Templates/System in Local Group Policy Editor. This Group Policy setting controls the following Windows Registry setting: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing\LocalSourcePath.
4) Windows Update.

Personally, I don't think it's worth hosting this somewhere internally. If you're using WSUS and are trying to workaround the problem where client machines try to download dot net 3.5 from WSUS (where it doesn't exist), then I recommend using group policy to set the policy listed above in 3) to allow clients to download .NET 3.5 directly from Windows Update. That has been working fine for me.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, Group Policy has disabled access to Windows Update on our servers, I'll get them to temporarily enable it for me I guess
You can capture a WIM of a system that already has it installed, and then use that WIM. If you extract the WIM to a path on the network, it could work that way. I played with this over a year ago and my recollection was that it was more trouble than I anticipated, but my end goal was for something else so YMMV.
1

Add-WindowsFeature -Source "D:\Sources\SxS" RSAT-ADDS

This works for me in windows server 2022 . My windows server DVD mount in D:\ drive.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.