winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Use C# wrapper objects for PowerShell cmdlet output

Open ryfu-msft opened this issue 2 years ago • 2 comments

Related to: #2796

Currently, the PowerShell module outputs a COM object which, based on feedback from the community, is not easily usable and also causes issues with certain behaviors such as getting properties and sorting by specific fields (id, version, etc.). This change fixes those issues by using a better formatted C# wrapper object around the data from the COM object and outputs that to PowerShell.

Tests: I added basic Pester tests but did not include them in the pipeline as the module looks for the wingetdev package to be installed on the build machine (specifically executing WindowsPackageManagerServer.exe) before creating any COM instances. I will work on that in a separate PR but I have included the basic tests here which can be run locally while having the localhost webserver running. Since we already have basic E2E test coverage for the module, it is not absolutely necessary right now.

Microsoft Reviewers: Open in CodeFlow

ryfu-msft avatar Jan 19 '23 18:01 ryfu-msft

/azp run

ryfu-msft avatar Jan 19 '23 18:01 ryfu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jan 19 '23 18:01 azure-pipelines[bot]

/azp run

ryfu-msft avatar Feb 06 '23 23:02 ryfu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 06 '23 23:02 azure-pipelines[bot]