powershellwinget

How to i get rid of the extra stuff at the to?


Hi I've been writing a PowerShell script that uses the Winget CLI tool but whenever I'm trying to use it in the way below this is the output that I keep getting when really what I want is the output that Powershell or CMD will give me if I just put it in normally


My Script

$AppsToUpdate1 = Start-Job { winget upgrade }
$AppsToUpdate2 = Wait-Job $AppsToUpdate1 | Out-Null; Receive-Job $AppsToUpdate1

Write-Output $AppsToUpdate2```

The output


   -
   \
   |
   /
   /
   /
   /
   -
   \
   |


   -

No installed package found matching input criteria.

The following packages have an upgrade available, but require explicit targeting for upgrade:
Name    Id              Version  Available Source
-------------------------------------------------
Discord Discord.Discord 1.0.9003 1.0.9156  winget

The output i want/CMD and PS will give

No installed package found matching input criteria.

The following packages have an upgrade available, but require explicit targeting for upgrade:
Name    Id              Version  Available Source
-------------------------------------------------
Discord Discord.Discord 1.0.9003 1.0.9156  winget

Solution


  • Solution options: