I'm having trouble installing the pswindowsupdate module on my Windows 2016 server using Invoke-Command. The installation works fine when I'm directly on the server console, but when I try to run it with Invoke-Command, I get a warning saying 'Unable to resolve package source 'https://www.powershellgallery.com/api/v2'. I've already confirmed that TLS1.2 is enabled on the server, so I'm not sure what the issue could be. Any insights would be appreciated!
1 Answer
Could you share what your script looks like? Just checking to see if there's anything off with it.
It's just this: {install-module -name pswindowsupdate}. It works perfectly fine in the console. I'm using: invoke-command -computername server1 -scriptblock {install-module -name pswindowsupdate}.