Created
February 25, 2018 00:51
-
-
Save kewalaka/bb6b5d40a212ad86b632410d21b4d385 to your computer and use it in GitHub Desktop.
Install .Net 3.5 using DSC & Azure Blob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configuration DotNet3 | |
{ | |
Import-DscResource -ModuleName xPSDesiredStateConfiguration | |
node localhost | |
{ | |
$dotNetSXSfolder = "C:\Installs\dotNetsxs" | |
File dotNetSXSFolder | |
{ | |
Type = "directory" | |
DestinationPath = $dotNetSXSfolder | |
Ensure = "Present" | |
} | |
xRemoteFile DotNet351SXS | |
{ | |
Uri = "https://xxxxxxxxxx.blob.core.windows.net/dotnet/2016/microsoft-windows-netfx3-ondemand-package.cab" | |
DestinationPath = "$dotNetSXSfolder" | |
DependsOn = "[File]dotNetSXSFolder" | |
MatchSource = $false | |
} | |
WindowsFeature FriendlyName | |
{ | |
Ensure = "Present" | |
Name = "NET-Framework-Core" | |
Source = $dotNetSXSfolder | |
} | |
} | |
} | |
# Creates a mof and applies the resource | |
$DscDir = "C:\DSC\" | |
New-Item $DscDir -ItemType Directory -ErrorAction SilentlyContinue | Out-Null | |
DotNet3 -OutputPath $DscDir | |
Start-DscConfiguration -Path $DscDir -Wait -Force -Verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For those scenarios where you don't want to rely on a full copy of the Windows media.
This relies on copying the above .cab from the Windows media and making the blob publicly available.
Typically use a file share resource, blob was an experiment.