Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Операционные системы » Microsoft Windows » Windows 10. Обсуждение работы (VIII)

Модерирует : KLASS, IFkO

KLASS (01-05-2018 12:01): Продолжение в Windows 10. Обсуждение работы (IX)  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

yaivanov



Newbie
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
# Службы диагностического отслеживания
$services = @(
"CDPSvc",
"DiagTrack",
"diagnosticshub.standardcollector.service",
"dmwappushservice",
"DusmSvc",
"lfsvc",
"MapsBroker",
"NcbService",
"SSDPSRV",
"tiledatamodelsvc",
"wcncsvc")
Foreach ($service In $services)
{
    Get-Service $service | Stop-Service -ErrorAction SilentlyContinue
    Get-Service $service | Set-Service -StartupType Disabled -ErrorAction SilentlyContinue
}
Remove-Variable services
# Отключение телеметрии и сбора данных для отправки
Set-AutologgerConfig -Name "AutoLogger-Diagtrack-Listener" -Start 0
Set-AutologgerConfig -Name "SQMLogger" -Start 0
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name AllowTelemetry -Value 1 -Force
IF (!(Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection))
{
    New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Value 1 -Force
IF (!(Test-Path HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows))
{
    New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows -Name CEIPEnable -Value 0 -Force
IF (!(Test-Path HKLM:\SYSTEM\ControlSet001\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener))
{
    New-Item -Path HKLM:\SYSTEM\ControlSet001\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener -Force
}
New-ItemProperty -Path HKLM:\SYSTEM\ControlSet001\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener -Name Start -Value 0 -Force
IF (!(Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat))
{
    New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat -Name AITEnable -Value 0 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat -Name DisableUAR -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat -Name DisableInventory -Value 1 -Force
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\PerfTrack))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\PerfTrack -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\PerfTrack -Name Disabled -Value 1 -Force
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name Disabled -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name DisableAutomaticTelemetryKeywordReporting -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name TelemetryServiceDisabled -Value 1 -Force
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\TestHooks))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\TestHooks -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\TestHooks -Name DisableAsimovUpload -Value 1 -Force
IF (!(Test-Path HKLM:\SYSTEM\ControlSet001\Services\DiagTrack))
{
    New-Item -Path HKLM:\SYSTEM\ControlSet001\Services\DiagTrack -Force
}
New-ItemProperty -Path HKLM:\SYSTEM\ControlSet001\Services\DiagTrack -Name Start -Value 4 -Force
# Отключение дополнительной телеметрии и Steps-Recorder
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Compatibility-Assistant -Force
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Compatibility-Troubleshooter -Force
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Inventory -Force
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Telemetry -Force
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Steps-Recorder -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Compatibility-Assistant -Name Enabled -Value 0 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Compatibility-Troubleshooter -Name Enabled -Value 0 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Inventory -Name Enabled -Value 0 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Telemetry -Name Enabled -Value 0 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Steps-Recorder -Name Enabled -Value 0 -Force
# Отключение и сброс собранной информации для предоставления рекламы
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Value 0 -Force
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Value 0 -Force
# Изменение частоты формирования отзывов на "Никогда"
IF (!(Test-Path HKCU:\Software\Microsoft\Siuf\Rules))
{
    New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Value 0 -Force
# Отключение Cortana
IF (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search"))
{
    New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name AllowCortana -Value 0 -Force
# Отключить Контроль Wi-Fi
IF (Get-NetAdapter -Physical | Where-Object {$_.Name -Match "Беспроводная" -or $_.Name -match "Wi-Fi"})
{
    IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config))
    {
        New-Item -Path HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config -Force
    }
    New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config -Name AutoConnectAllowedOEM -Value 0 -Force
}
# Отключение в "Журналах Windows/Безопасность" сообщения "Платформа фильтрации IP-пакетов Windows разрешила подключение"
auditpol /set /subcategory:"{0CCE9226-69AE-11D9-BED3-505054503030}" /success:disable /failure:disable
# Удаление пункта "Закрепить на Начальном экране" из контекстного меню
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\PintoStartScreen -Force -ErrorAction SilentlyContinue
# Удаление пункта "Закрепить на Начальном экране" для .exe-файлов из контекстного меню
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\exefile\shellex\ContextMenuHandlers\PintoStartScreen -Force -ErrorAction SilentlyContinue
# Открывать "Этот компьютер" в Проводнике
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1 -Force
# Показывать скрытые файлы
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name Hidden -Value 1 -Force
# Показывать расширения файлов
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -Value 0 -Force
# Отключить гибридный спящий режим
IF (!(Test-Path HKLM:\SYSTEM\CurrentControlSet\Control\Power))
{
    New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power -Force
}
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power -Name HibernateEnabled -Value 0 -Force
# Запрашивать подтверждение при удалении файлов
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ConfirmFileDelete -Value 1 -Force
# Отключение автозапуска с внешних носителей
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers -Name DisableAutoplay -Value 1 -Force
# He дoбaвлять "- яpлык" для coздaвaeмыx яpлыкoв
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name link -Type Binary -Value ([byte[]](00,00,00,00)) -Force
# Отключение поиска программ в Microsoft Store
IF (!(Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer))
{
    New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Value 1 -Force
# Не хранить сведения о зоне происхождения вложенных файлов
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Value 1 -Force
# Отключение SmartScreen для приложений и файлов
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name SmartScreenEnabled -Type String -Value Off -Force
# Отключение SmartScreen в IE
IF (!(Test-Path "HKCU:\Software\Microsoft\Internet Explorer\PhishingFilter"))
{
    New-Item -Path "HKCU:\Software\Microsoft\Internet Explorer\PhishingFilter" -Force
}
New-ItemProperty -Path "HKCU:\Software\Microsoft\Internet Explorer\PhishingFilter" -Name EnabledV9 -Value 0 -Force
# Отключение SmartScreen в Edge
$edge = (Get-AppxPackage -AllUsers "Microsoft.MicrosoftEdge").PackageFamilyName
IF (!(Test-Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\PhishingFilter"))
{
    New-Item -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\PhishingFilter" -Force
}
New-ItemProperty -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\PhishingFilter" -Name EnabledV9 -Value 0 -Force
Remove-Variable edge
# Не показывать при прикреплении окна, что можно прикрепить рядом с ним
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SnapAssist -Value 0 -Force
# Отключить управление принтером, используемым по умолчанию, со стороны Windows
IF (!(Test-Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows"))
{
    New-Item -Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Force
}
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name LegacyDefaultPrinterMode -Value 1 -Force
# Сохранение скриншотов по Win+PrtScr на Рабочем столе
IF (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{b7bede81-df94-4682-a7d8-57a52620b86f}"))
{
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{b7bede81-df94-4682-a7d8-57a52620b86f}" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{b7bede81-df94-4682-a7d8-57a52620b86f}" -Name RelativePath -Type String -Value %USERPROFILE%\Desktop -Force
# Установка качества фона рабочего стола на 100 %
IF (!(Test-Path "HKCU:\Control Panel\Desktop"))
{
    New-Item -Path "HKCU:\Control Panel\Desktop" -Force
}
New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name JPEGImportQuality -Value 100 -Force
# Отключение отображения вкладки "Предыдущие версии" в свойствах файлов
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name NoPreviousVersionsPage -Value 1 -Force
# Отключить флажки для выбора элементов
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name AutoCheckSelect -Value 0 -Force
# Изменение пути переменных сред для временных файлов
IF (!(Test-Path $env:SystemDrive\Temp))
{
    New-Item -Path $env:SystemDrive\Temp -Type Directory -Force
}
[Environment]::SetEnvironmentVariable("TMP","$env:SystemDrive\Temp","User")
[Environment]::SetEnvironmentVariable("TEMP","$env:SystemDrive\Temp","User")
[Environment]::SetEnvironmentVariable("TMP","$env:SystemDrive\Temp","Machine")
[Environment]::SetEnvironmentVariable("TEMP","$env:SystemDrive\Temp","Machine")
# Удаление UWP-приложений
Get-AppxPackage -AllUsers | Where-Object name -CNotLike *Store* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -CNotLike *Store* | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
# Отключение компонентов
$features = @(
# Отключение службы "Факсы и сканирование"
'FaxServicesClientPackage',
# Отключение компонентов прежних версий
'LegacyComponents',
# Отключение компонентов работы с мультимедиа
'MediaPlayback',
# Отключение PowerShell 2.0
'MicrosoftWindowsPowerShellV2',
'MicrosoftWindowsPowershellV2Root',
# Отключение службы XPS
'Printing-XPSServices-Features',
# Отключение и удаление поддержки протокола SMB1 на клиенте
# 'SMB1Protocol',
# Отключение службы "Клиент рабочих папок"
'WorkFolders-Client',
# Отключение просмотрщика XPS
'Xps-Foundation-Xps-Viewer')
Foreach ($feature in $features)
{
    Disable-WindowsOptionalFeature -Online -FeatureName $feature -NoRestart
}
Remove-Variable features
# Добавить Средство просмотра фотографий Windows в пункт контекстного меню "Открыть с помощью"
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open -Name MuiVerb -Type String -Value "@photoviewer.dll,-3043" -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Name Clsid -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" -Force
# Ассоциация со Средством просмотра фотографий Windows
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.bmp))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.bmp -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.bmp\PersistentHandler))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.bmp\PersistentHandler -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.bmp -Name "(Default)" -Type String -Value Paint.Picture -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.bmp -Name "Content Type" -Type String -Value image/bmp -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.bmp -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.bmp\PersistentHandler -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.bmp))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.bmp -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.bmp\OpenWithProgids))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.bmp\OpenWithProgids -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.bmp\PersistentHandler))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.bmp\PersistentHandler -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.bmp -Name "(Default)" -Type String -Value Paint.Picture -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.bmp -Name "Content Type" -Type String -Value image/bmp -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.bmp -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.bmp -Name Paint.Picture -Type String -Value "" -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.bmp -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap -Name ImageOptionFlags -Value 1 -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap -Name FriendlyTypeName -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll,-3056" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\DefaultIcon))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\DefaultIcon -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\DefaultIcon -Name "(Default)" -Type String -Value "%SystemRoot%\System32\imageres.dll,-70" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\shell\open\command))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\shell\open\command -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\shell\open\DropTarget))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\shell\open\DropTarget -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\shell\open\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap\shell\open\DropTarget -Name Clsid -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp -Force
}
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\OpenWithList))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\OpenWithList -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\OpenWithList -Name a -Type String -Value PhotoViewer.dll -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\OpenWithList -Name MRUList -Type String -Value a -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\OpenWithProgids))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\OpenWithProgids -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\OpenWithProgids -Name Paint.Picture -Type None -Value ([byte[]]::new(0)) -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.jpeg))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.jpeg -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.jpeg\PersistentHandler))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.jpeg\PersistentHandler -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.jpeg -Name "(Default)" -Type String -Value jpegfile -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.jpeg -Name "Content Type" -Type String -Value image/jpeg -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.jpeg -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.jpeg\PersistentHandler -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.jpeg))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.jpeg -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.jpeg\OpenWithProgids))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.jpeg\OpenWithProgids -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.jpeg\PersistentHandler))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.jpeg\PersistentHandler -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpeg -Name "(Default)" -Type String -Value jpegfile -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpeg -Name "Content Type" -Type String -Value image/jpeg -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpeg -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpeg -Name jpegfile -Type String -Value "" -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpeg -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg -Name EditFlags -Value 1 -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg -Name ImageOptionFlags -Value 1 -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg -Name FriendlyTypeName -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll,-3055" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\DefaultIcon))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\DefaultIcon -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\DefaultIcon -Name "(Default)" -Type String -Value "%SystemRoot%\System32\imageres.dll,-72" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open\command))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open\command -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open\DropTarget))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open\DropTarget -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open -Name MuiVerb -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043" -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg\shell\open\DropTarget -Name Clsid -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg -Force
}
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\OpenWithList))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\OpenWithList -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\OpenWithList -Name a -Type String -Value PhotoViewer.dll -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\OpenWithList -Name MRUList -Type String -Value a -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\OpenWithProgids))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\OpenWithProgids -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\OpenWithProgids -Name jpegfile -Type None -Value ([byte[]]::new(0)) -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg -Force
}
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\OpenWithList))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\OpenWithList -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\OpenWithList -Name a -Type String -Value PhotoViewer.dll -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\OpenWithList -Name MRUList -Type String -Value a -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\OpenWithProgids))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\OpenWithProgids -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\OpenWithProgids -Name jpegfile -Type None -Value ([byte[]]::new(0)) -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.jpg))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.jpg -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.jpg\PersistentHandler))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.jpg\PersistentHandler -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.jpg -Name "(Default)" -Type String -Value jpegfile -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.jpg -Name "Content Type" -Type String -Value image/jpeg -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.jpg -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.jpg\PersistentHandler -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.jpg))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.jpg -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.jpg\OpenWithProgids))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.jpg\OpenWithProgids -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.jpg\PersistentHandler))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.jpg\PersistentHandler -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpg -Name "(Default)" -Type String -Value jpegfile -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpg -Name "Content Type" -Type String -Value image/jpeg -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpg -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpg -Name jpegfile -Type String -Value "" -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.jpg -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.png))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.png -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.png\PersistentHandler))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.png\PersistentHandler -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.png -Name "(Default)" -Type String -Value pngfile -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.png -Name "Content Type" -Type String -Value image/png -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.png -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.png\PersistentHandler -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.png))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.png -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.png\OpenWithProgids))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.png\OpenWithProgids -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.png\PersistentHandler))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.png\PersistentHandler -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.png -Name "(Default)" -Type String -Value pngfile -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.png -Name "Content Type" -Type String -Value image/png -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.png -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.png -Name pngfile -Type String -Value "" -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.png -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\DefaultIcon))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\DefaultIcon -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\DefaultIcon -Name "(Default)" -Type String -Value "%SystemRoot%\System32\imageres.dll,-71" -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\shell\open\command))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\shell\open\command -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\shell\open\DropTarget))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\shell\open\DropTarget -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png -Name ImageOptionFlags -Value 1 -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png -Name FriendlyTypeName -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll,-3057" -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\shell\open\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png\shell\open\DropTarget -Name Clsid -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png -Force
}
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\OpenWithList))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\OpenWithList -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\OpenWithList -Name a -Type String -Value PhotoViewer.dll -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\OpenWithList -Name MRUList -Type String -Value a -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\OpenWithProgids))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\OpenWithProgids -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\OpenWithProgids -Name jpegfile -Type None -Value ([byte[]]::new(0)) -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.tif))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.tif -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.tif\PersistentHandler))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.tif\PersistentHandler -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.tif -Name "(Default)" -Type String -Value TIFImage.Document -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.tif -Name "Content Type" -Type String -Value image/tiff -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.tif -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.tif\PersistentHandler -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.tif))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.tif -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.tiff\OpenWithProgids))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.tif\OpenWithProgids -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.tif\PersistentHandler))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.tif\PersistentHandler -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tif -Name "(Default)" -Type String -Value TIFImage.Document -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tif -Name "Content Type" -Type String -Value image/tif -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tif -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tif -Name TIFImage.Document -Type String -Value "" -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tif -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif -Force
}
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithList))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithList -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithList -Name a -Type String -Value PhotoViewer.dll -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithList -Name MRUList -Type String -Value a -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithProgids))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithProgids -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithProgids -Name TIFImage.Document -Type None -Value ([byte[]]::new(0)) -Force
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.tiff))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.tiff -Force
}
IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\.tiff\PersistentHandler))
{
    New-Item -Path Registry::HKEY_CLASSES_ROOT\.tiff\PersistentHandler -Force
}
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.tiff -Name "(Default)" -Type String -Value TIFImage.Document -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.tiff -Name "Content Type" -Type String -Value image/tiff -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.tiff -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.tiff\PersistentHandler -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.tiff))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.tiff -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.tiff\OpenWithProgids))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.tiff\OpenWithProgids -Force
}
IF (!(Test-Path HKLM:\SOFTWARE\Classes\.tiff\PersistentHandler))
{
    New-Item -Path HKLM:\SOFTWARE\Classes\.tiff\PersistentHandler -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tiff -Name "(Default)" -Type String -Value TIFImage.Document -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tiff -Name "Content Type" -Type String -Value image/tiff -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tiff -Name PerceivedType -Type String -Value image -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tiff -Name TIFImage.Document -Type String -Value "" -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\.tiff -Name "(Default)" -Type String -Value "{098f2470-bae0-11cd-b579-08002b30bfeb}" -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff -Force
}
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\OpenWithList))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\OpenWithList -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\OpenWithList -Name a -Type String -Value PhotoViewer.dll -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\OpenWithList -Name MRUList -Type String -Value a -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\OpenWithProgids))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\OpenWithProgids -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\OpenWithProgids -Name TIFImage.Document -Type None -Value ([byte[]]::new(0)) -Force
Foreach ($type in @("Paint.Picture", "jpegfile", "pngfile"))
{
    IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\$type\shell\open))
    {
        New-Item -Path Registry::HKEY_CLASSES_ROOT\$type\shell\open -Force
    }
    IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\$type\shell\open\command))
    {
        New-Item -Path Registry::HKEY_CLASSES_ROOT\$type\shell\open\command -Force
    }
    New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\$type\shell\open" -Name MuiVerb -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043" -Force
    New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\$type\shell\open\command" -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force
}
IF (!(Test-Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\MuiCache"))
{
    New-Item -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\MuiCache" -Force
}
New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\MuiCache" -Name "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll.FriendlyAppName" -Type String -Value "Просмотр фотографий Windows" -Force
New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\MuiCache" -Name "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll.ApplicationCompany" -Type String -Value "Microsoft Corporation" -Force
$sid = (Get-CimInstance Win32_UserAccount -Filter "name='$env:USERNAME'").SID
$task = @"
\Registry\user\$sid\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\UserChoice [1 6 9 17]
\Registry\user\$sid\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\UserChoice [1 6 9 17]
\Registry\user\$sid\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\UserChoice [1 6 9 17]
\Registry\user\$sid\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\UserChoice [1 6 9 17]
\Registry\user\$sid\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\UserChoice [1 6 9 17]
\Registry\user\$sid\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\UserChoice [1 6 9 17]
"@
Add-Content $env:SystemDrive\registry.txt $task -Force
regini.exe $env:SystemDrive\registry.txt
Remove-Item $env:SystemDrive\registry.txt -Force
Remove-Variable sid, task
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\UserChoice" -Name ProgId -Value PhotoViewer.FileAssoc.Bitmap -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\UserChoice" -Name ProgId -Value PhotoViewer.FileAssoc.Jpeg -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\UserChoice" -Name ProgId -Value PhotoViewer.FileAssoc.Jpeg -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\UserChoice" -Name ProgId -Value PhotoViewer.FileAssoc.Png -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\UserChoice" -Name ProgId -Value PhotoViewer.FileAssoc.Tiff -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\UserChoice" -Name ProgId -Value PhotoViewer.FileAssoc.Tiff -Force
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PhotoViewer.FileAssoc.Bitmap_.bmp -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PhotoViewer.FileAssoc.Jpeg_.jpeg -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PhotoViewer.FileAssoc.Jpeg_.jpg -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PhotoViewer.FileAssoc.Png_.png -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PhotoViewer.FileAssoc.Tiff_.tiff -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PhotoViewer.FileAssoc.Tiff_.tif -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PBrush_.jpg -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PBrush_.jpeg -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PBrush_.png -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PBrush_.bmp -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PBrush_.tiff -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name PBrush_.tif -Value 0 -Force
IF (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities"))
{
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities" -Name ApplicationDescription -Type String -Value "@%ProgramFiles%\\Windows Photo Viewer\\photoviewer.dll,-3069" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities" -Name ApplicationName -Type String -Value "@%ProgramFiles%\\Windows Photo Viewer\\photoviewer.dll,-3009" -Force
IF (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations"))
{
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .bmp -Type String -Value PhotoViewer.FileAssoc.Bitmap -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .jpg -Type String -Value PhotoViewer.FileAssoc.Jpeg -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .jpeg -Type String -Value PhotoViewer.FileAssoc.Jpeg -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .png -Type String -Value PhotoViewer.FileAssoc.Png -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .tif -Type String -Value PhotoViewer.FileAssoc.Tiff -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" -Name .tiff -Type String -Value PhotoViewer.FileAssoc.Tiff -Force
# Удаление OneDrive
Stop-Process -Name OneDrive -ErrorAction SilentlyContinue
Start-Sleep -s 3
Start-Process "$env:SystemRoot\SysWOW64\OneDriveSetup.exe" /uninstall -NoNewWindow -Wait
Start-Sleep -s 3
Remove-Item "$env:USERPROFILE\OneDrive" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:ProgramData\Microsoft OneDrive" -Recurse -Force -ErrorAction SilentlyContinue
IF (!(Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive))
{
    New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive
}
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Name DisableFileSyncNGSC -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Name DisableFileSync -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Name DisableMeteredNetworkFileSync -Value 0 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive -Name DisableLibrariesDefaultSaveToOneDrive -Value 1 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\OneDrive -Name DisablePersonalSync -Value 1 -Force
Remove-Item -Path "Registry::HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "Registry::HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" -Force -ErrorAction SilentlyContinue
Unregister-ScheduledTask onedrive* -Confirm:$false
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Run -Name OneDrive -Force -ErrorAction SilentlyContinue
Remove-ItemProperty -Path HKCU:\Environment -Name OneDrive -Force -ErrorAction SilentlyContinue
# Отключение задач диагностического отслеживания в Планировщике задач
Get-ScheduledTask appuriverifierdaily,
appuriverifierinstall,
BackupTask,
"Automatic App Update",
CleanupOfflineContent,
Consolidator,
DmClient,
DmClientOnScenarioDownload,
dusmtask,
"EDP Policy Manager",
FamilySafetyMonitor,
FamilySafetyMonitorToastTask,
FamilySafetyRefreshTask,
"File History (maintenance mode)",
GatherNetworkInfo,
MapsToastTask,
MapsUpdateTask,
"Microsoft Compatibility Appraiser",
Microsoft-Windows-DiskDiagnosticDataCollector,
"MNO Metadata Parser",
NetworkStateChangeTask,
ProgramDataUpdater,
Proxy,
QueueReporting,
SilentCleanup,
SpeechModelDownloadTask,
StartupAppTask,
TempSignedLicenseExchange,
UsbCeip,
WinSAT,
XblGameSaveTask | Disable-ScheduledTask
# Не показывать советы по использованию Windows
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SoftLandingEnabled -Value 0 -Force
# Блокировка рекламы в Skype
$hostfile = "$env:SystemRoot\System32\drivers\etc\hosts"
$domains = @("apps.skype.com", "a.config.skype.com", "b.config.skype.com", "cdn.eyewonder.com", "g.msn.com", "pipe.skype.com", "rad.msn.com")
Foreach ($hostentry in $domains)  
{
    IF (!(Get-Content $hostfile | Select-String "0.0.0.0 `t $hostentry"))
    {
        Add-Content -Path $hostfile -value "0.0.0.0 `t $hostentry"
    }
}
Remove-Variable hostfile, domains
# Отключение игровой панели
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -Value 0 -Force
IF (!(Test-Path HKCU:\System\GameConfigStore))
{
    New-Item -Path HKCU:\System\GameConfigStore -Force
}
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -Value 0 -Force
# Отключение записи и трансляции игр
IF (!(Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR))
{
    New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR -Name AllowgameDVR -Value 0 -Force
# Отключение режима игры
IF (!(Test-Path HKCU:\Software\Microsoft\GameBar))
{
    New-Item -Path HKCU:\Software\Microsoft\GameBar -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name AllowAutoGameMode -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name AutoGameModeEnabled -Value 0 -Force
New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name ShowStartupPanel -Value 0 -Force
# Отключение оптимизации доставки для обновлений с других ПК
Get-Service -Name DoSvc | Stop-Service -ErrorAction SilentlyContinue
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings -Name DownloadMode -Type String -Value 0 -Force
# Включение в Планировщике задач запуска очистки обновлений Windows
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup" -Name StateFlags1337 -Value 2 -Force
$action = New-ScheduledTaskAction -Execute "$env:SystemRoot\System32\cleanmgr.exe" -Argument "/sagerun:1337"
$trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 90 -At 9am
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$principal = New-ScheduledTaskPrincipal -UserID $env:USERNAME -RunLevel Highest
$params = @{
"TaskName"    = "Update Cleanup"
"Action"    = $action
"Trigger"    = $trigger
"Settings"    = $settings
"Principal"    = $principal
}
Register-ScheduledTask @Params -Force
Remove-Variable action, trigger, settings, principal, params
# Включение в Планировщике задач очистки временной папки
$action = New-ScheduledTaskAction -Execute "Powershell.exe" -Argument 'Get-ChildItem -Path "$env:TEMP" -Recurse -Force | Remove-Item -Recurse -Force'
$trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 62 -At 9am
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$principal = New-ScheduledTaskPrincipal -UserID System -RunLevel Highest
$params = @{
"TaskName"    = "Temp"
"Action"    = $action
"Trigger"    = $trigger
"Settings"    = $settings
"Principal"    = $principal
}
Register-ScheduledTask @Params -Force
Remove-Variable action, trigger, settings, principal, params
# Включение в Планировщике задач очистки папки %SYSTEMROOT%\SoftwareDistribution\Download
$action = New-ScheduledTaskAction -Execute "Powershell.exe" -Argument @"
`$getservice = Get-Service -Name wuauserv
`$getservice.WaitForStatus('Stopped', '01:00:00')
Get-ChildItem -Path $env:SystemRoot\SoftwareDistribution\Download -Recurse -Force | Remove-Item -Recurse -Force
"@
$trigger = New-ScheduledTaskTrigger -Weekly -At 9am -DaysOfWeek Thursday -WeeksInterval 4
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$principal = New-ScheduledTaskPrincipal -UserID System -RunLevel Highest
$params = @{
"TaskName"    = "SoftwareDistribution"
"Action"    = $action
"Trigger"    = $trigger
"Settings"    = $settings
"Principal"    = $principal
}
Register-ScheduledTask @Params -Force
Remove-Variable action, trigger, settings, principal, params
# Включение в Планировщике задач очистки папки %SYSTEMROOT%\LiveKernelReports
$action = New-ScheduledTaskAction -Execute "Powershell.exe" -Argument @"
`$dir = '$env:SystemRoot\LiveKernelReports'
`$foldersize = (Get-ChildItem -Path `$dir -Recurse | Measure-Object -Property Length -Sum).Sum/1MB
IF (`$foldersize -GT 100)
{
    Get-ChildItem -Path `$dir -Recurse -Force | Remove-Item -Recurse -Force
}
"@
$trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 62 -At 9am
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$principal = New-ScheduledTaskPrincipal -UserID System -RunLevel Highest
$params = @{
"TaskName"    = "LiveKernelReports"
"Action"    = $action
"Trigger"    = $trigger
"Settings"    = $settings
"Principal"    = $principal
}
Register-ScheduledTask @Params -Force
Remove-Variable action, trigger, settings, principal, params
# Включение в Планировщике задач очистки папки %SYSTEMROOT%\Logs\CBS
$action = New-ScheduledTaskAction -Execute "Powershell.exe" -Argument @"
`$dir = '$env:SystemRoot\Logs\CBS'
`$foldersize = (Get-ChildItem -Path `$dir -Recurse | Measure-Object -Property Length -Sum).Sum/1MB
IF (`$foldersize -GT 10)
{
    Get-ChildItem -Path `$dir -Recurse -Force | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
}
"@
$trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 62 -At 9am
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$principal = New-ScheduledTaskPrincipal -UserID System -RunLevel Highest
$params = @{
"TaskName"    = "CBS"
"Action"    = $action
"Trigger"    = $trigger
"Settings"    = $settings
"Principal"    = $principal
}
Register-ScheduledTask @Params -Force
Remove-Variable action, trigger, settings, principal, params
# Включение в Планировщике задач очистки папки %SYSTEMROOT%\Windows\Installer\$PatchCache$\Managed
$action = New-ScheduledTaskAction -Execute "Powershell.exe" -Argument 'Get-ChildItem -Path "$env:SystemRoot\Installer\`$PatchCache$\Managed" -Recurse -Force | Remove-Item -Recurse -Force'
$trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 120 -At 9am
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$principal = New-ScheduledTaskPrincipal -UserID System -RunLevel Highest
$params = @{
"TaskName"    = "PatchCache"
"Action"    = $action
"Trigger"    = $trigger
"Settings"    = $settings
"Principal"    = $principal
}
Register-ScheduledTask @Params -Force
Remove-Variable action, trigger, settings, principal, params
# Домашняя страница в IE
IF (!(Test-Path "HKCU:\Software\Microsoft\Internet Explorer\Main"))
{
    New-Item -Path "HKCU:\Software\Microsoft\Internet Explorer\Main" -Force
}
New-ItemProperty -Path "HKCU:\Software\Microsoft\Internet Explorer\Main" -Name "Start Page" -Type String -Value https://yandex.ru -Force
# Запускать IE с вкладками с последнего сеанса просмотра
IF (!(Test-Path "HKCU:\Software\Microsoft\Internet Explorer\ContinuousBrowsing"))
{
    New-Item -Path "HKCU:\Software\Microsoft\Internet Explorer\ContinuousBrowsing" -Force
}
New-ItemProperty -Path "HKCU:\Software\Microsoft\Internet Explorer\ContinuousBrowsing" -Name Enabled -Value 1 -Force
# Запретить приложениям работать в фоновом режиме
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications -Force
}
$edge = (Get-AppxPackage -AllUsers "Microsoft.MicrosoftEdge").PackageFamilyName
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\$edge" -Name DisabledByUser -Value 1 -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\$edge" -Name Disabled -Value 1 -Force
Remove-Variable edge
$store = (Get-AppxPackage -AllUsers "Microsoft.WindowsStore").PackageFamilyName
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\$store" -Name DisabledByUser -Value 1 -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\$store" -Name Disabled -Value 1 -Force
Remove-Variable store
$settings = (Get-AppxPackage -AllUsers "windows.immersivecontrolpanel").PackageFamilyName
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\$settings" -Name DisabledByUser -Value 1 -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\$settings" -Name Disabled -Value 1 -Force
Remove-Variable settings
$connect = (Get-AppxPackage -AllUsers "Microsoft.PPIProjection").PackageFamilyName
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\$connect" -Name DisabledByUser -Value 1 -Force
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\$connect" -Name Disabled -Value 1 -Force
Remove-Variable connect
# Скрыть в IE кнопку, которая открывает Microsoft Edge
IF (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main"))
{
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" -Name HideNewEdgeButton -Value 1 -Force
# Удалить в IE пункт "Отзывы и предложения"
IF (!(Test-Path "HKCU:\Software\Policies\Microsoft\Internet Explorer\Restrictions"))
{
    New-Item -Path "HKCU:\Software\Policies\Microsoft\Internet Explorer\Restrictions" -Force
}
New-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Internet Explorer\Restrictions" -Name NoHelpItemSendFeedback -Value 1 -Force
# Включить контроль памяти
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01 -Value 1 -Force
# Удалять временные файлы, не используемые в приложениях
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -Value 1 -Force
# Использовать последнюю установленную версию .NET Framework для всех приложений
IF (!(Test-Path HKLM:\SOFTWARE\Microsoft\.NETFramework))
{
    New-Item -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Value 1 -Force
IF (!(Test-Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework))
{
    New-Item -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Value 1 -Force
# Использовать сценарий автоматической настройки прокси в IE
IF (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap"))
{
    New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap" -Force
}
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap" -Name ProxyByPass -Value 0 -Force
IF (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"))
{
    New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Force
}
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name AutoConfigURL -Type String -Value https://antizapret.prostovpn.org/proxy.pac -Force
# Не показывать рекомендации в меню Пуск
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -Value 0 -Force
# Отключить автоматическую установку рекомендованных приложений
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -Value 0 -Force
# Отключение возможностей потребителя Microsoft
IF (!(Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent))
{
    New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableWindowsConsumerFeatures -Value 1 -Force
# Удаление пункта "Изменить с помощью Paint 3D" из контекстного меню
$exts = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff")
Foreach ($ext in $exts)  
{
    Remove-Item -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$ext\Shell\3D Edit" -Recurse -Force -ErrorAction SilentlyContinue  
}
Remove-Variable exts
# Удаление пункта "Передать на устройство" из контекстного меню
IF (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"))
{
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Type String -Value "Play to menu" -Force
# Удаление пункта "Отправить" из контекстного меню
Remove-Item -LiteralPath "Registry::HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\ModernSharing" -Recurse -Force -ErrorAction SilentlyContinue
# Удалить раздел "Люди" с панели задач
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -Value 0 -Force
# Не выполнять мастер запуска IE в первый раз
IF (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main"))
{
    New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" -Name DisableFirstRunCustomize -Value 1 -Force
# Скрыть папку "Объемные объекты" из "Этот компьютер"
IF (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag"))
{
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -Type String -Value Hide -Force
IF (!(Test-Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag"))
{
    New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -Type String -Value Hide -Force
# Отключение Flash Player в Edge
$edge = (Get-AppxPackage -AllUsers "Microsoft.MicrosoftEdge").PackageFamilyName
IF (!(Test-Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\Addons"))
{
    New-Item -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\Addons" -Force
}
New-ItemProperty -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\Addons" -Name FlashPlayerEnabled -Value 0 -Force
Remove-Variable edge
# Открывать в новом окне предыдущие страницы в Edge
$edge = (Get-AppxPackage -AllUsers "Microsoft.MicrosoftEdge").PackageFamilyName
IF (!(Test-Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\ContinuousBrowsing"))
{
    New-Item -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\ContinuousBrowsing" -Force
}
New-ItemProperty -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\ContinuousBrowsing" -Name Enabled -Value 1 -Force
New-ItemProperty -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\Main" -Name AskToCloseAllTabs -Value 0 -Force
Remove-Variable edge
# Не показывать недавно используемые папки на панели быстрого доступа
IF (!(Test-Path Software\Microsoft\Windows\CurrentVersion\Explorer))
{
    New-Item -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Value 0 -Force
# Не показывать недавно использовавшиеся файлы на панели быстрого доступа
IF (!(Test-Path Software\Microsoft\Windows\CurrentVersion\Explorer))
{
    New-Item -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Value 0 -Force
# Удаление пункта "Предоставить доступ к" из контекстного меню
IF (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"))
{
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{f81e9010-6ea4-11ce-a7ff-00aa003ca9f6}" -Type String -Value "" -Force
# Удаление пункта "Включить Bitlocker" из контекстного меню
$keys = @(
"encrypt-bde",
"encrypt-bde-elev",
"manage-bde",
"resume-bde",
"resume-bde-elev",
"unlock-bde")
Foreach ($key In $keys)
{
    IF(!(Test-Path Registry::HKEY_CLASSES_ROOT\Drive\shell\$key))
    {
        New-Item -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\$key -Force
    }
    New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\$key -Name ProgrammaticAccessOnly -Type String -Value "" -Force
 
}
Remove-Variable keys
# Удаление из автозагрузки иконки Защитника Windows
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run -Name SecurityHealth -Force -ErrorAction SilentlyContinue
# Добавить пункт "Извлечь" для MSI в контекстное меню
IF (!(Test-Path -Path "Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Извлечь\Command"))
{
    New-Item -Path "Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Извлечь\Command" -Force
}
New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Извлечь\Command" -Name "(Default)" -Type String -Value 'msiexec.exe /a "%1" /qb TARGETDIR="%1 extracted"' -Force
# Не использовать мои данные для входа для автоматического завершения настройки устройства после перезапуска или обновления
$sid = (Get-CimInstance Win32_UserAccount -Filter "name='$env:USERNAME'").SID
IF (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$sid"))
{
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$sid" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$sid" -Name OptOut -Value 1 -Force
Remove-Variable sid
# Отключение пользовательских служб в Windows 10
$services = @(
"CDPUserSvc_*",
"OneSyncSvc_*",
"WpnUserService_*")
Foreach ($service In $services)
{
    Get-Service $service | Stop-Service -ErrorAction SilentlyContinue
}
New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\CDPUserSvc -Name Start -Value 4 -Force
New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\CDPUserSvc -Name UserServiceFlags -Value 0 -Force
New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\OneSyncSvc -Name Start -Value 4 -Force
New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\OneSyncSvc -Name UserServiceFlags -Value 0 -Force
New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\WpnUserService -Name Start -Value 4 -Force
New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\WpnUserService -Name UserServiceFlags -Value 0 -Force
Remove-Variable services
# Скрыть кнопку Windows Ink Workspace
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PenWorkspace))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PenWorkspace -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PenWorkspace -Name PenWorkspaceButtonDesiredVisibility -Value 0 -Force
# Запретить Windows отслеживать запуски приложений меню "Пуск" и результатов поиска
IF (!(Test-Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced))
{
    New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name Start_TrackProgs -Value 0 -Force
 
Stop-Process -ProcessName explorer

Всего записей: 30 | Зарегистр. 27-01-2018 | Отправлено: 15:14 23-03-2018 | Исправлено: yaivanov, 15:35 23-03-2018
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Операционные системы » Microsoft Windows » Windows 10. Обсуждение работы (VIII)
KLASS (01-05-2018 12:01): Продолжение в Windows 10. Обсуждение работы (IX)


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru