We get further, but I am realizing that my hope of using your script(s) without SCCM installed probably just won't work. I now get:
08/26/2022 05:53:44 uninstalling ConfigMgr agent...
08/26/2022 05:53:44 Starting RemoveSCCMClient function
08/26/2022 05:53:44 An error occurred when trying to email the logs, here is the error: This command cannot be run due to the error: The system cannot find the file specified.
08/26/2022 05:53:44 Something failed, aborting Migrate process
08/26/2022 05:53:44 setting HKLM:\HKEY_LOCAL_MACHINE\SOFTWARE\My Company atStep 10 String
08/26/2022 05:53:44 registry value set successfully