Guest User

Untitled

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