Add-WindowsFeature - Make Available but not Install

Welcome Forums General PowerShell Q&A Add-WindowsFeature - Make Available but not Install

This topic contains 2 replies, has 2 voices, and was last updated by

1 year, 1 month ago.

  • Author
  • #91181

    Points: 2
    Rank: Member

    Hi there,

    I've got a requirement to build Windows Server 2012 images where .Net FW 3.5 is available to install (e.g for any applications that require it – e.g. SQL Server), but not installed on every server by default.

    It appears that a vanilla OS build leaves the feature in a state of 'Removed'.

    I use Packer to build the image, so my current workaround is to install the feature from the mounted .iso:

    Install-WindowsFeature –Name NET-Framework-Features –source $cdDrive:\sources\sxs -Confirm:$false

    ...and then immediately remove it:

    Install-WindowsFeature –Name NET-Framework-Features -Confirm:$false this then leaves the feature as "available" (and has obviously copied the requisite files to the local sxs folder...)

    But this seems a bit clunky (and adds a couple of minutes to the build).



  • #91199

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    There's nothing native on PowerShell per se that would achieve this; you'd want to look into the Deployment Toolkit, or use DISM or something to add the necessary binaries to your base OS image.

  • #91201

    Points: 2
    Rank: Member

    Thanks for taking the time to reply Don – thought not. There's a nice '-Remove' parameter for trimming down the sxs cache, but not the opposite for pre-staging them...

    Thanks anyway.

The topic ‘Add-WindowsFeature - Make Available but not Install’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort