Skip to content

Commit 8e1909d

Browse files
authored
Update how-to-determine-which-versions-are-installed.md (#43947)
Make script to detect old .NET Framework versions compatible with PowerShell 2
1 parent 7a95d4c commit 8e1909d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/framework/migration-guide/how-to-determine-which-versions-are-installed.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ ForEach-Object {
266266
$parentName = $_.PSChildName
267267
Get-ChildItem -LiteralPath $_.PSPath |
268268
Where-Object {
269-
if ($_.Property -contains 'Version') { $name = Get-ItemPropertyValue -Path $_.PSPath -Name Version }
270-
if ($name -and ($_.Property -contains 'SP')) { $sp = Get-ItemPropertyValue -Path $_.PSPath -Name SP }
271-
if ($_.Property -contains 'Install') { $install = Get-ItemPropertyValue -Path $_.PSPath -Name Install }
269+
if ($_.Property -contains 'Version') { $name = $((Get-ItemProperty -Path "Registry::$_").Version) }
270+
if ($name -and ($_.Property -contains 'SP')) { $sp = $((Get-ItemProperty -Path "Registry::$_").SP) }
271+
if ($_.Property -contains 'Install') { $install = $((Get-ItemProperty -Path "Registry::$_").Install) }
272272
if (-not $install) {
273273
Write-Host -Object " $($parentName) $($name)"
274274
}

0 commit comments

Comments
 (0)