文本A- # Enable automatic restart after Windows Update installation
- Function EnableUpdateRestart {
- Write-Output "Enabling Windows Update automatic restart..."
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MusNotification.exe" -Name "Debugger" -ErrorAction SilentlyContinue
- }
- # Disable nightly wake-up for Automatic Maintenance and Windows Updates
- Function DisableMaintenanceWakeUp {
- Write-Output "Disabling nightly wake-up for Automatic Maintenance..."
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" -Name "WakeUp" -Type DWord -Value 0
- }
复制代码 提取Write-Output "之间的字符"
生成文本B
Enabling Windows Update automatic restart...
Disabling nightly wake-up for Automatic Maintenance...
翻译得到文本C 替换掉文本A Write-Output "之间的字符"
正在启用Windows Update自动重启...
禁用夜间唤醒以进行自动维护...
希望WHY老师教下 我比较笨最好备注下 谢谢老师 |