Hello, JamLow
Welcome to Microsoft Community.
The warning messages you are encountering do not necessarily indicate a problem or infection. They are part of PowerShell's inherent security measures designed to safeguard against potentially harmful scripts or modules from untrusted sources.
Moreover, when you execute the Get-InstalledModule command, PowerShell scans its known repositories for modules. If a repository is not set as trusted, you will receive the "Untrusted repository" warning. However, this doesn't imply that there is an issue; it simply informs you that the repository's trust level is currently set to untrusted.
Additionally, the references to NuGet arise because PowerShell employs NuGet as a package provider for installing modules. If NuGet is not found in the specified locations or the PATH environment variable, PowerShell offers to install it for you.
Conversely, the "UnableToUninstallAsOtherScriptsNeedThisScript" warning is displayed when attempting to uninstall a script that other scripts are dependent on.
To mitigate these warnings, you can designate the repository as trusted using the Set-PSRepository cmdlet. However, only proceed with this action if you are certain that the repository is secure.
For instance, you can use the following command:
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
This command establishes the PowerShell Gallery (PSGallery) as a trusted repository, thereby averting the "Untrusted repository" warnings. However, it's crucial to exercise caution and exclusively install scripts and modules from sources you trust to evade potential security risks. If uncertain, it's advisable to leave the repository as untrusted and manually inspect scripts and modules before installation.
Yuhao Li
Microsoft Community Technical Support