</span><spanid=__span-0-2><aid=__codelineno-0-2name=__codelineno-0-2href=#__codelineno-0-2></a><spanclass=w></span><spanclass=nt>"Content"</span><spanclass=p>:</span><spanclass=w></span><spanclass=s2>"Reset Windows Update"</span><spanclass=p>,</span>
</span><spanid=__span-1-6><aid=__codelineno-1-6name=__codelineno-1-6href=#__codelineno-1-6></a><spanclass=cm> Performs various tasks in an attempt to repair Windows Update</span>
</span><spanid=__span-1-9><aid=__codelineno-1-9name=__codelineno-1-9href=#__codelineno-1-9></a><spanclass=cm> 1. (Aggressive Only) Scans the system for corruption using chkdsk, SFC, and DISM</span>
</span><spanid=__span-1-12><aid=__codelineno-1-12name=__codelineno-1-12href=#__codelineno-1-12></a><spanclass=cm> /scan - Runs an online scan on the volume</span>
</span><spanid=__span-1-13><aid=__codelineno-1-13name=__codelineno-1-13href=#__codelineno-1-13></a><spanclass=cm> /perf - Uses more system resources to complete a scan as fast as possible</span>
</span><spanid=__span-1-15><aid=__codelineno-1-15name=__codelineno-1-15href=#__codelineno-1-15></a><spanclass=cm> /scannow - Scans integrity of all protected system files and repairs files with problems when possible</span>
</span><spanid=__span-1-17><aid=__codelineno-1-17name=__codelineno-1-17href=#__codelineno-1-17></a><spanclass=cm> /Online - Targets the running operating system</span>
</span><spanid=__span-1-18><aid=__codelineno-1-18name=__codelineno-1-18href=#__codelineno-1-18></a><spanclass=cm> /Cleanup-Image - Performs cleanup and recovery operations on the image</span>
</span><spanid=__span-1-19><aid=__codelineno-1-19name=__codelineno-1-19href=#__codelineno-1-19></a><spanclass=cm> /RestoreHealth - Scans the image for component store corruption and attempts to repair the corruption using Windows Update</span>
</span><spanid=__span-1-21><aid=__codelineno-1-21name=__codelineno-1-21href=#__codelineno-1-21></a><spanclass=cm> Ran twice in case DISM repaired SFC</span>
</span><spanid=__span-1-22><aid=__codelineno-1-22name=__codelineno-1-22href=#__codelineno-1-22></a><spanclass=cm> 2. Stops Windows Update Services</span>
</span><spanid=__span-1-23><aid=__codelineno-1-23name=__codelineno-1-23href=#__codelineno-1-23></a><spanclass=cm> 3. Remove the QMGR Data file, which stores BITS jobs</span>
</span><spanid=__span-1-24><aid=__codelineno-1-24name=__codelineno-1-24href=#__codelineno-1-24></a><spanclass=cm> 4. (Aggressive Only) Renames the DataStore and CatRoot2 folders</span>
</span><spanid=__span-1-25><aid=__codelineno-1-25name=__codelineno-1-25href=#__codelineno-1-25></a><spanclass=cm> DataStore - Contains the Windows Update History and Log Files</span>
</span><spanid=__span-1-26><aid=__codelineno-1-26name=__codelineno-1-26href=#__codelineno-1-26></a><spanclass=cm> CatRoot2 - Contains the Signatures for Windows Update Packages</span>
</span><spanid=__span-1-27><aid=__codelineno-1-27name=__codelineno-1-27href=#__codelineno-1-27></a><spanclass=cm> 5. Renames the Windows Update Download Folder</span>
</span><spanid=__span-1-28><aid=__codelineno-1-28name=__codelineno-1-28href=#__codelineno-1-28></a><spanclass=cm> 6. Deletes the Windows Update Log</span>
</span><spanid=__span-1-29><aid=__codelineno-1-29name=__codelineno-1-29href=#__codelineno-1-29></a><spanclass=cm> 7. (Aggressive Only) Resets the Security Descriptors on the Windows Update Services</span>
</span><spanid=__span-1-30><aid=__codelineno-1-30name=__codelineno-1-30href=#__codelineno-1-30></a><spanclass=cm> 8. Reregisters the BITS and Windows Update DLLs</span>
</span><spanid=__span-1-31><aid=__codelineno-1-31name=__codelineno-1-31href=#__codelineno-1-31></a><spanclass=cm> 9. Removes the WSUS client settings</span>
</span><spanid=__span-1-33><aid=__codelineno-1-33name=__codelineno-1-33href=#__codelineno-1-33></a><spanclass=cm> 11. Gets and deletes all BITS jobs</span>
</span><spanid=__span-1-34><aid=__codelineno-1-34name=__codelineno-1-34href=#__codelineno-1-34></a><spanclass=cm> 12. Sets the startup type of the Windows Update Services then starts them</span>
</span><spanid=__span-1-35><aid=__codelineno-1-35name=__codelineno-1-35href=#__codelineno-1-35></a><spanclass=cm> 13. Forces Windows Update to check for updates</span>
</span><spanid=__span-1-38><aid=__codelineno-1-38name=__codelineno-1-38href=#__codelineno-1-38></a><spanclass=cm> If specified, the script will take additional steps to repair Windows Update that are more dangerous, take a significant amount of time, or are generally unnecessary</span>
</span><spanid=__span-1-44><aid=__codelineno-1-44name=__codelineno-1-44href=#__codelineno-1-44></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-45><aid=__codelineno-1-45name=__codelineno-1-45href=#__codelineno-1-45></a><spanclass=c># Wait for the first progress bar to show, otherwise the second one won't show</span>
</span><spanid=__span-1-49><aid=__codelineno-1-49name=__codelineno-1-49href=#__codelineno-1-49></a><spanclass=c># Scan system for corruption</span>
</span><spanid=__span-1-50><aid=__codelineno-1-50name=__codelineno-1-50href=#__codelineno-1-50></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Scanning for corruption..."</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-51><aid=__codelineno-1-51name=__codelineno-1-51href=#__codelineno-1-51></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Running chkdsk..."</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-52><aid=__codelineno-1-52name=__codelineno-1-52href=#__codelineno-1-52></a><spanclass=c># 2>&1 redirects stdout, alowing iteration over the output</span>
</span><spanid=__span-1-54><aid=__codelineno-1-54name=__codelineno-1-54href=#__codelineno-1-54></a><spanclass=c># Write stdout to the Verbose stream</span>
</span><spanid=__span-1-57><aid=__codelineno-1-57name=__codelineno-1-57href=#__codelineno-1-57></a><spanclass=c># Get the index of the total percentage</span>
</span><spanid=__span-1-67><aid=__codelineno-1-67name=__codelineno-1-67href=#__codelineno-1-67></a><spanclass=cm><# And the current percentage is greater than the previous one #></span><spanclass=p>`</span>
</span><spanid=__span-1-72><aid=__codelineno-1-72name=__codelineno-1-72href=#__codelineno-1-72></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Running chkdsk... ($percent%)"</span><spanclass=n>-PercentComplete</span><spanclass=nv>$percent</span>
</span><spanid=__span-1-76><aid=__codelineno-1-76name=__codelineno-1-76href=#__codelineno-1-76></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Running SFC..."</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-78><aid=__codelineno-1-78name=__codelineno-1-78href=#__codelineno-1-78></a><spanclass=c># SFC has a bug when redirected which causes it to output only when the stdout buffer is full, causing the progress bar to move in chunks</span>
</span><spanid=__span-1-80><aid=__codelineno-1-80name=__codelineno-1-80href=#__codelineno-1-80></a><spanclass=c># Write stdout to the Verbose stream</span>
</span><spanid=__span-1-83><aid=__codelineno-1-83name=__codelineno-1-83href=#__codelineno-1-83></a><spanclass=c># Filter for lines that contain a percentage that is greater than the previous one</span>
</span><spanid=__span-1-86><aid=__codelineno-1-86name=__codelineno-1-86href=#__codelineno-1-86></a><spanclass=c># Use a different method to get the percentage that accounts for SFC's Unicode output</span>
</span><spanid=__span-1-99><aid=__codelineno-1-99name=__codelineno-1-99href=#__codelineno-1-99></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Running SFC... ($percent%)"</span><spanclass=n>-PercentComplete</span><spanclass=nv>$percent</span>
</span><spanid=__span-1-103><aid=__codelineno-1-103name=__codelineno-1-103href=#__codelineno-1-103></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Running DISM..."</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-106><aid=__codelineno-1-106name=__codelineno-1-106href=#__codelineno-1-106></a><spanclass=c># Write stdout to the Verbose stream</span>
</span><spanid=__span-1-109><aid=__codelineno-1-109name=__codelineno-1-109href=#__codelineno-1-109></a><spanclass=c># Filter for lines that contain a percentage that is greater than the previous one</span>
</span><spanid=__span-1-118><aid=__codelineno-1-118name=__codelineno-1-118href=#__codelineno-1-118></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Running DISM... ($percent%)"</span><spanclass=n>-PercentComplete</span><spanclass=nv>$percent</span>
</span><spanid=__span-1-122><aid=__codelineno-1-122name=__codelineno-1-122href=#__codelineno-1-122></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Running SFC again..."</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-125><aid=__codelineno-1-125name=__codelineno-1-125href=#__codelineno-1-125></a><spanclass=c># Write stdout to the Verbose stream</span>
</span><spanid=__span-1-128><aid=__codelineno-1-128name=__codelineno-1-128href=#__codelineno-1-128></a><spanclass=c># Filter for lines that contain a percentage that is greater than the previous one</span>
</span><spanid=__span-1-143><aid=__codelineno-1-143name=__codelineno-1-143href=#__codelineno-1-143></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Running SFC... ($percent%)"</span><spanclass=n>-PercentComplete</span><spanclass=nv>$percent</span>
</span><spanid=__span-1-146><aid=__codelineno-1-146name=__codelineno-1-146href=#__codelineno-1-146></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Status</span><spanclass=s2>"Completed"</span><spanclass=n>-PercentComplete</span><spanclass=n>100</span>
</span><spanid=__span-1-150><aid=__codelineno-1-150name=__codelineno-1-150href=#__codelineno-1-150></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Stopping Windows Update Services..."</span><spanclass=n>-PercentComplete</span><spanclass=n>10</span>
</span><spanid=__span-1-151><aid=__codelineno-1-151name=__codelineno-1-151href=#__codelineno-1-151></a><spanclass=c># Stop the Windows Update Services</span>
</span><spanid=__span-1-163><aid=__codelineno-1-163name=__codelineno-1-163href=#__codelineno-1-163></a><spanclass=c># Remove the QMGR Data file</span>
</span><spanid=__span-1-164><aid=__codelineno-1-164name=__codelineno-1-164href=#__codelineno-1-164></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Renaming/Removing Files..."</span><spanclass=n>-PercentComplete</span><spanclass=n>20</span>
</span><spanid=__span-1-165><aid=__codelineno-1-165name=__codelineno-1-165href=#__codelineno-1-165></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>3</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Renaming/Removing Files"</span><spanclass=n>-Status</span><spanclass=s2>"Removing QMGR Data files..."</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-170><aid=__codelineno-1-170name=__codelineno-1-170href=#__codelineno-1-170></a><spanclass=c># Rename the Windows Update Log and Signature Folders</span>
</span><spanid=__span-1-171><aid=__codelineno-1-171name=__codelineno-1-171href=#__codelineno-1-171></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>3</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Renaming/Removing Files"</span><spanclass=n>-Status</span><spanclass=s2>"Renaming the Windows Update Log, Download, and Signature Folder..."</span><spanclass=n>-PercentComplete</span><spanclass=n>20</span>
</span><spanid=__span-1-176><aid=__codelineno-1-176name=__codelineno-1-176href=#__codelineno-1-176></a><spanclass=c># Rename the Windows Update Download Folder</span>
</span><spanid=__span-1-177><aid=__codelineno-1-177name=__codelineno-1-177href=#__codelineno-1-177></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>3</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Renaming/Removing Files"</span><spanclass=n>-Status</span><spanclass=s2>"Renaming the Windows Update Download Folder..."</span><spanclass=n>-PercentComplete</span><spanclass=n>20</span>
</span><spanid=__span-1-180><aid=__codelineno-1-180name=__codelineno-1-180href=#__codelineno-1-180></a><spanclass=c># Delete the legacy Windows Update Log</span>
</span><spanid=__span-1-181><aid=__codelineno-1-181name=__codelineno-1-181href=#__codelineno-1-181></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>3</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Renaming/Removing Files"</span><spanclass=n>-Status</span><spanclass=s2>"Removing the old Windows Update log..."</span><spanclass=n>-PercentComplete</span><spanclass=n>80</span>
</span><spanid=__span-1-187><aid=__codelineno-1-187name=__codelineno-1-187href=#__codelineno-1-187></a><spanclass=c># Reset the Security Descriptors on the Windows Update Services</span>
</span><spanid=__span-1-188><aid=__codelineno-1-188name=__codelineno-1-188href=#__codelineno-1-188></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Resetting the WU Service Security Descriptors..."</span><spanclass=n>-PercentComplete</span><spanclass=n>25</span>
</span><spanid=__span-1-189><aid=__codelineno-1-189name=__codelineno-1-189href=#__codelineno-1-189></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>4</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Resetting the WU Service Security Descriptors"</span><spanclass=n>-Status</span><spanclass=s2>"Resetting the BITS Security Descriptor..."</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-191><aid=__codelineno-1-191name=__codelineno-1-191href=#__codelineno-1-191></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>4</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Resetting the WU Service Security Descriptors"</span><spanclass=n>-Status</span><spanclass=s2>"Resetting the wuauserv Security Descriptor..."</span><spanclass=n>-PercentComplete</span><spanclass=n>50</span>
</span><spanid=__span-1-193><aid=__codelineno-1-193name=__codelineno-1-193href=#__codelineno-1-193></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>4</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Resetting the WU Service Security Descriptors"</span><spanclass=n>-Status</span><spanclass=s2>"Completed"</span><spanclass=n>-PercentComplete</span><spanclass=n>100</span>
</span><spanid=__span-1-197><aid=__codelineno-1-197name=__codelineno-1-197href=#__codelineno-1-197></a><spanclass=c># Reregister the BITS and Windows Update DLLs</span>
</span><spanid=__span-1-198><aid=__codelineno-1-198name=__codelineno-1-198href=#__codelineno-1-198></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Reregistering DLLs..."</span><spanclass=n>-PercentComplete</span><spanclass=n>40</span>
</span><spanid=__span-1-232><aid=__codelineno-1-232name=__codelineno-1-232href=#__codelineno-1-232></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Resetting WinSock..."</span><spanclass=n>-PercentComplete</span><spanclass=n>65</span>
</span><spanid=__span-1-240><aid=__codelineno-1-240name=__codelineno-1-240href=#__codelineno-1-240></a><spanclass=c># Get and delete all BITS jobs</span>
</span><spanid=__span-1-241><aid=__codelineno-1-241name=__codelineno-1-241href=#__codelineno-1-241></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Deleting BITS jobs..."</span><spanclass=n>-PercentComplete</span><spanclass=n>75</span>
</span><spanid=__span-1-247><aid=__codelineno-1-247name=__codelineno-1-247href=#__codelineno-1-247></a><spanclass=c># Change the startup type of the Windows Update Services and start them</span>
</span><spanid=__span-1-248><aid=__codelineno-1-248name=__codelineno-1-248href=#__codelineno-1-248></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Starting Windows Update Services..."</span><spanclass=n>-PercentComplete</span><spanclass=n>90</span>
</span><spanid=__span-1-249><aid=__codelineno-1-249name=__codelineno-1-249href=#__codelineno-1-249></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>9</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Starting Windows Update Services"</span><spanclass=n>-Status</span><spanclass=s2>"Starting BITS..."</span><spanclass=n>-PercentComplete</span><spanclass=n>0</span>
</span><spanid=__span-1-251><aid=__codelineno-1-251name=__codelineno-1-251href=#__codelineno-1-251></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>9</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Starting Windows Update Services"</span><spanclass=n>-Status</span><spanclass=s2>"Starting wuauserv..."</span><spanclass=n>-PercentComplete</span><spanclass=n>25</span>
</span><spanid=__span-1-253><aid=__codelineno-1-253name=__codelineno-1-253href=#__codelineno-1-253></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>9</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Starting Windows Update Services"</span><spanclass=n>-Status</span><spanclass=s2>"Starting AppIDSvc..."</span><spanclass=n>-PercentComplete</span><spanclass=n>50</span>
</span><spanid=__span-1-254><aid=__codelineno-1-254name=__codelineno-1-254href=#__codelineno-1-254></a><spanclass=c># The AppIDSvc service is protected, so the startup type has to be changed in the registry</span>
</span><spanid=__span-1-257><aid=__codelineno-1-257name=__codelineno-1-257href=#__codelineno-1-257></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>9</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Starting Windows Update Services"</span><spanclass=n>-Status</span><spanclass=s2>"Starting CryptSvc..."</span><spanclass=n>-PercentComplete</span><spanclass=n>75</span>
</span><spanid=__span-1-259><aid=__codelineno-1-259name=__codelineno-1-259href=#__codelineno-1-259></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>9</span><spanclass=n>-ParentId</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Starting Windows Update Services"</span><spanclass=n>-Status</span><spanclass=s2>"Completed"</span><spanclass=n>-PercentComplete</span><spanclass=n>100</span>
</span><spanid=__span-1-262><aid=__codelineno-1-262name=__codelineno-1-262href=#__codelineno-1-262></a><spanclass=c># Force Windows Update to check for updates</span>
</span><spanid=__span-1-263><aid=__codelineno-1-263name=__codelineno-1-263href=#__codelineno-1-263></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Forcing discovery..."</span><spanclass=n>-PercentComplete</span><spanclass=n>95</span>
</span><spanid=__span-1-268><aid=__codelineno-1-268name=__codelineno-1-268href=#__codelineno-1-268></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Status</span><spanclass=s2>"Completed"</span><spanclass=n>-PercentComplete</span><spanclass=n>100</span>
</span><spanid=__span-1-271><aid=__codelineno-1-271name=__codelineno-1-271href=#__codelineno-1-271></a><spanclass=nv>$MessageboxTitle</span><spanclass=p>=</span><spanclass=s2>"Reset Windows Update "</span>
</span><spanid=__span-1-272><aid=__codelineno-1-272name=__codelineno-1-272href=#__codelineno-1-272></a><spanclass=nv>$Messageboxbody</span><spanclass=p>=</span><spanclass=p>(</span><spanclass=s2>"Stock settings loaded.</span><spanclass=se>`n</span><spanclass=s2> Please reboot your computer"</span><spanclass=p>)</span>
</span><spanid=__span-1-277><aid=__codelineno-1-277name=__codelineno-1-277href=#__codelineno-1-277></a><spanclass=nb>Write-Host</span><spanclass=s2>"-- Reset All Windows Update Settings to Stock -"</span>
</span><spanid=__span-1-280><aid=__codelineno-1-280name=__codelineno-1-280href=#__codelineno-1-280></a><spanclass=c># Remove the progress bars</span>
</span><spanid=__span-1-281><aid=__codelineno-1-281name=__codelineno-1-281href=#__codelineno-1-281></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>0</span><spanclass=n>-Activity</span><spanclass=s2>"Repairing Windows Update"</span><spanclass=n>-Completed</span>
</span><spanid=__span-1-282><aid=__codelineno-1-282name=__codelineno-1-282href=#__codelineno-1-282></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>1</span><spanclass=n>-Activity</span><spanclass=s2>"Scanning for corruption"</span><spanclass=n>-Completed</span>
</span><spanid=__span-1-285><aid=__codelineno-1-285name=__codelineno-1-285href=#__codelineno-1-285></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>4</span><spanclass=n>-Activity</span><spanclass=s2>"Resetting the WU Service Security Descriptors"</span><spanclass=n>-Completed</span>
</span><spanid=__span-1-290><aid=__codelineno-1-290name=__codelineno-1-290href=#__codelineno-1-290></a><spanclass=nb>Write-Progress</span><spanclass=n>-Id</span><spanclass=n>9</span><spanclass=n>-Activity</span><spanclass=s2>"Starting Windows Update Services"</span><spanclass=n>-Completed</span>