[CmdletBinding()] param( [string]$Csv ) $ErrorActionPreference = 'Stop' $themeKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes' $theme = Get-ItemProperty -LiteralPath $themeKey -ErrorAction SilentlyContinue $personalize = Get-ItemProperty -LiteralPath (Join-Path $themeKey 'Personalize') -ErrorAction SilentlyContinue $advanced = Get-ItemProperty -LiteralPath 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -ErrorAction SilentlyContinue $desktop = Get-ItemProperty -LiteralPath 'HKCU:\Control Panel\Desktop' -ErrorAction SilentlyContinue function Get-Value { param($Object, [string]$Name) if ($null -eq $Object) { return $null } $property = $Object.PSObject.Properties[$Name] if ($null -eq $property) { return $null } return $property.Value } $summary = [pscustomobject]@{ CurrentTheme = Get-Value -Object $theme -Name 'CurrentTheme' Wallpaper = Get-Value -Object $desktop -Name 'Wallpaper' AppsUseLightTheme = Get-Value -Object $personalize -Name 'AppsUseLightTheme' SystemUsesLightTheme = Get-Value -Object $personalize -Name 'SystemUsesLightTheme' HideFileExt = Get-Value -Object $advanced -Name 'HideFileExt' Hidden = Get-Value -Object $advanced -Name 'Hidden' ShowSuperHidden = Get-Value -Object $advanced -Name 'ShowSuperHidden' LaunchTo = Get-Value -Object $advanced -Name 'LaunchTo' TaskbarGlomLevel = Get-Value -Object $advanced -Name 'TaskbarGlomLevel' } Write-Host 'Тема и проводник:' $summary | Format-List $themeFiles = @() foreach ($directory in @((Join-Path $env:SystemRoot 'Resources\Themes'), (Join-Path $env:LOCALAPPDATA 'Microsoft\Windows\Themes'))) { if (Test-Path -LiteralPath $directory -PathType Container) { $themeFiles += @(Get-ChildItem -LiteralPath $directory -Filter '*.theme' -File -ErrorAction SilentlyContinue) } } Write-Host ("Установленных .theme-файлов: {0}" -f $themeFiles.Count) $themeFiles | Select-Object -First 30 Name, FullName | Format-Table -AutoSize if ($Csv) { $parent = Split-Path -Parent $Csv if ($parent -and -not (Test-Path -LiteralPath $parent)) { New-Item -ItemType Directory -Path $parent | Out-Null } $summary | Export-Csv -LiteralPath $Csv -NoTypeInformation -Encoding UTF8 Write-Host "Отчёт сохранён: $Csv" } Write-Host 'Тема, обои и настройки проводника не изменялись.'