aboutsummaryrefslogtreecommitdiffstats
path: root/coin/pre-provisioning/qtci-windows-10_22H2-x86_64/01-enable-dotnet-framework.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'coin/pre-provisioning/qtci-windows-10_22H2-x86_64/01-enable-dotnet-framework.ps1')
-rw-r--r--coin/pre-provisioning/qtci-windows-10_22H2-x86_64/01-enable-dotnet-framework.ps123
1 files changed, 23 insertions, 0 deletions
diff --git a/coin/pre-provisioning/qtci-windows-10_22H2-x86_64/01-enable-dotnet-framework.ps1 b/coin/pre-provisioning/qtci-windows-10_22H2-x86_64/01-enable-dotnet-framework.ps1
new file mode 100644
index 00000000..effb4974
--- /dev/null
+++ b/coin/pre-provisioning/qtci-windows-10_22H2-x86_64/01-enable-dotnet-framework.ps1
@@ -0,0 +1,23 @@
+# The DirectX SDK installer requires .Net framework 3.5 which isn't installed by default
+
+# NOTE! Windows Update service need to be enabled when running this script!
+
+$netFeature = "NetFx3"
+try {
+ $netFeatureState = (Get-WindowsOptionalFeature -Online -FeatureName "$netFeature").State
+ if ($netFeatureState -eq "Enabled") {
+ Write-Host ".Net Framework is already installed"
+ exit 0
+ }
+} catch {
+ Write-Host "Could not find .Net Framework Windows feature."
+ exit 1
+}
+
+Write-Host "Installing .Net Framework client"
+try {
+ Enable-WindowsOptionalFeature -Online -FeatureName "$netFeature" -All -NoRestart
+} catch {
+ Write-Host "Could not install .Net framework"
+ exit 1
+}