I recently noticed some strange behavior from PowerShell on my computer when attempting to import all of the available modules :
Get-Module -ListAvailable | Import-Module -DisableNameChecking
PS [MikeFRobbins.com]\>Import-Module -Name PSWindowsUpdate
Are you sure you want to perform this action?
Performing the operation “Bing Desktop v1.3.1[9 MB]?” on target “PC01”.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is “Y”):
I could create some elaborate script to iterate through each module and tell me what module is trying to install Bing Desktop, or I can simply use the -PassThru parameter:
Get-Module -ListAvailable | Import-Module -DisableNameChecking -PassThru
As shown in the previous image, the message about wanting to install Bing Desktop shows up just after the PSTerminalServices module and just before the PSWindowsUpdate module, both of which are custom third party PowerShell modules.
In order to determine which one is causing the issue, manually import them one at a time:
Import-Module -Name PSTerminalServices
Import-Module -Name PSWindowsUpdate
The PSWindowsUpdate module which is a custom third party module that I downloaded from the TechNet script repository is causing the issue. Answering yes to the message will result in Bing Desktop being installed on your computer without any further confirmation:
I decided to revisit this issue prior to publishing this blog. I downloaded the latest version of the PSWindowsUpdate module from the TechNet script repository and it does not appear to have this issue.
The moral of the story is that if you experience issues with a PowerShell module, especially a custom third party one, make sure you have the latest version because your issue may have already been resolved in the newest version :-).