Guest User

Untitled

a guest
Feb 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #
  2. # Get all installed Dotnet versions
  3. # Tom 2018-02-01
  4. #
  5. Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
  6. Get-ItemProperty -name Version,Release -EA 0 |
  7. Where-Object { $_.PSChildName -match '^(?!S)\p{L}'} |
  8. Select-Object PSChildName, Version, Release, @{
  9. name="Product"
  10. expression={
  11. switch -regex ($_.Release) {
  12. "378389" { [Version]"4.5" }
  13. "378675|378758" { [Version]"4.5.1" }
  14. "379893" { [Version]"4.5.2" }
  15. "393295|393297" { [Version]"4.6" }
  16. "394254|394271" { [Version]"4.6.1" }
  17. "394802|394806" { [Version]"4.6.2" }
  18. "460798" { [Version]"4.7" }
  19. "460805" { [Version]"4.7.02053" }
  20. {$_ -gt 460805} { [Version]"Undocumented 4.7 or higher, please update script" }
  21. }
  22. }
  23. }
Add Comment
Please, Sign In to add comment