This is why advanced functions/scripts/modules have header data that details what everything does. As an example, for Start-WindowsCleanup, under '.NOTES', the following has been present since the option to clean-up the Component Store was added: Likewise, Start-WindowsCleanup actually requires input verification before it performs an image base reset. Ultimately, it is the end-user's decision to select the 'Yes' button despite all of the documented information within the function itself and is not a fault of the function itself, as some users do not require Windows Update and use other methods for integrating updates.
I am not 100% sure, as I have only used it on Windows 10 and Windows Server 2016/2019. Considering the Windows Management Framework 5.1 that you can get from Microsoft includes PowerShell 5 and its cmdlets, I'm inclined to say that it would work, though I cannot say for certain if every removal process would work as intended. You could try running it with just the minimal amount of removals first and if it completes without issue, try some of the more advanced removal options.
Is this how the script execution ends? Still nothing happens. - https://prnt.sc/u8q63w I don't think it does - https://prnt.sc/u8q9xt Why?
Updated 12/06/2020 - A new registry key gets added that contains both the function's last run time as well as the StateFlags integer value. Each time the function is run, it checks this registry key and ensures none of the previous StateFlags' integer values are still present. This will ensure any set StateFlags integer values are removed if the clean-up process is exited or closed before the Windows Disk Clean-up utility has completed. - Included the removal of additional histories and recent documents. - Additional primary function and helper function updates and improvements.