Deploy .NET Framework 3.5 by using Deployment Image Servicing and Management (DISM) instead of Chocolatey and some notes on PowerShell colours
Posted by jpluimers on 2025/01/07
Since every now and then, like testing software developed with older tools, you need to run older software.
This always works: [Wayback /Archive] Deploy .NET Framework 3.5 by using Deployment Image Servicing and Management (DISM) | Microsoft Learn
DISM /Online /Enable-Feature /FeatureName:NetFx3 /AllUse
/Allto enable all parent features of the specified feature.
(The /All is needed because software requiring .NET Framework 3.5 also require the parent features).
Notes:
- Tested on Windows 10 and Windows 11 in 2022.
- It can take a really long time (more than just a few minutes!) even on fast connections.
- Installing through Chocolatey with `choco install
dotnet3.5fails on Windows 11 (have not tried on Windows 10) with the classical red on black PowerShell default error theme*:
ERROR: The term 'wmic' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The install of DotNet3.5 was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\DotNet3.5\Tools\ChocolateyInstall.ps1'.
You can check the installed .NET frameworks before/after this action. On a newly installed Windows 11 system, these were:
PS C:\Users\jeroenp> Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.PSChildName -Match '^(?!S)\p{L}'} | Select PSChildName, version PSChildName Version ----------- ------- Client 4.8.09032 Full 4.8.09032 Client 4.0.0.0 PS C:\Users\jeroenp> Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.PSChildName -Match '^(?!S)\p{L}'} | Select PSChildName, version PSChildName Version ----------- ------- v2.0.50727 2.0.50727.4927 v3.0 3.0.30729.4926 Windows Communication Foundation 3.0.4506.4926 Windows Presentation Foundation 3.0.6920.4902 v3.5 3.5.30729.4926 Client 4.8.09032 Full 4.8.09032 Client 4.0.0.0
Script from [Wayback/Archive] How to manage .NET Framework on Windows 10 & 11 | PDQ (I forgot how I bumped into this, but I luckily kept a note I did).
PowerShell colours
- this was even worse in older PowerShell versions, and yes you can change the PowerShell red on black default error theme:
- [WaybackSave/Wayback2021/Archive] PowerShell display colors : PowerShell
$host.PrivateData.ErrorForegroundColor = [System.ConsoleColor]::magentacode:Put that in your $profile, adjust the color to one you want.This is the same solution as from the link below, but stored in the user profile, and using magenta instead of white.
- [Wayback/Archive] PowerTip: Change Color of PowerShell Errors – Scripting Blog [archived]
$Host.PrivateData.ErrorForegroundColor = 'white'
PowerShell colors and their combinations:
- [Wayback/Archive] List of all colors available for PowerShell? – Stack Overflow (thanks [Wayback/Archive] RayofCommand and [Wayback/Archive] Tim Abell)
A
Pretty grid
$colors = [enum]::GetValues([System.ConsoleColor]) Foreach ($bgcolor in $colors){ Foreach ($fgcolor in $colors) { Write-Host "$fgcolor|" -ForegroundColor $fgcolor -BackgroundColor $bgcolor -NoNewLine } Write-Host " on $bgcolor" }[WaybackSave/Archive] tUGiD.png (950×193)
Updated colours in newer powershell:
[WaybackSave/Archive] QOSgM.png (1357×263)
https://gist.github.com/timabell/cc9ca76964b59b2a54e91bda3665499e
Actually you can show even more colours in the (in Windows 11 default) Windows Terminal console, as answered by [Wayback/Archive] not2qubit.
- [Wayback/Archive] output all the colour combinations for text/background in powershell https://stackoverflow.com/questions/20541456/list-of-all-colors-available-for-powershell/41954792#41954792 · GitHub
The function has a front seat in my
$profileand each time I runcolors, it’s just a wonderfully elegant aesthetic experience. Beauty Is Our Business. Thanks a lot.

- [Wayback/Archive] ConsoleColor Enum (System) | Microsoft Learn
- [Wayback/Archive] Beauty Is Our Business

ISBN 0387972994
This book is a birthday tribute to EwDijkstra, with about 25 articles written by friends.
The book title comes from something written or spoken by EwDijkstra. The ‘our’ refers to computer scientists (with the EMPHasis on science).
Queries:
- [WaybackSave/Archive] powershell error red on black – Google Suche
- [WaybackSave/Archive] powershell colors – Google Suche
--jeroen











Leave a comment