Загрузка данных


Get-ChildItem -LiteralPath "$env:LOCALAPPDATA\Apps\2.0" `
    -Filter user.config -Recurse -File -ErrorAction SilentlyContinue |
ForEach-Object {
    try {
        [xml]$cfg = Get-Content -LiteralPath $_.FullName -Raw
        $settings = $cfg.SelectNodes(
            "//setting[@name='myServer' or @name='cntRowView']"
        )

        if ($settings.Count -gt 0) {
            [pscustomobject]@{
                File       = $_.FullName
                Modified   = $_.LastWriteTime
                myServer   = ($settings |
                    Where-Object { $_.name -eq 'myServer' }).value
                cntRowView = ($settings |
                    Where-Object { $_.name -eq 'cntRowView' }).value
            }
        }
    }
    catch {}
} | Format-List