
Utilizo el módulo PSWindowsUpdate para actualizar la mayoría de las máquinas en mi lugar de trabajo. Sin embargo, cuando ejecuto el comando Get-WUList (o Get-WUInstall) a través de un script de Powershell, aparece un mensaje en blanco como se ve en la imagen adjunta. Realmente me gustaría poder ver qué actualizaciones se van a instalar o se están instalando.
Cada vez que ejecuto los comandos manualmente, todo aparece como debería. Intenté jugar con el comando write-host, pero terminé con un lío de texto que no es realmente descifrable. ¿Alguien tiene alguna idea sobre cómo puedo obtener el resultado de Get-WUList/Get-WUInstall cuando se ejecuta mediante un script y no manualmente?
*Debo tener en cuenta que uso el Administrador de Escritorio Remoto (RDM) para acceder de forma remota a mis sistemas. Tienen una función llamada Agente de escritorio remoto que permite ejecutar scripts en varias máquinas al mismo tiempo a través de la interfaz RDM.
EDITADO PARA INCLUIR GUIÓN
Echo "Enabling Windows Update Services"
Get-Service wuauserv | Set-Service -StartupType Manual
Get-Service bits | Set-Service -StartupType Manual
Echo "Enabling updates for additional Microsoft components and software"
Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -Confirm:$false
Echo "Querying Microsoft Update Server for Windows Updates"
Get-WUList -MicrosoftUpdate | Select Title, KB, Status
Echo "Hiding Unnecessary Updates"
Hide-WUUpdate -Title "*Visio*" -Confirm:$false
Hide-WUUpdate -Title "*OneDrive*" -Confirm:$false
Hide-WUUpdate -Title "*OneNote*" -Confirm:$false
Hide-WUUpdate -Title "*Outlook*" -Confirm:$false
Hide-WUUpdate -Title "*Skype*" -Confirm:$false
Echo "Downloading and Installing Windows Updates"
Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreReboot | Select Title, KB
Echo "Stopping Windows Update Services"
Get-Service wuauserv | Stop-Service -PassThru | Set-Service -StartupType Disabled
Get-Service bits | Stop-Service -PassThru | Set-Service -StartupType Disabled