In this short article, we will be demonstrating on how to capture an object in powershell and then export that object to csv.
First, we need an object to export. How about Get-AppxPackage cmdlet?
The Get-AppxPackage -AllUsers cmdlet will return all non-provisioned applications installed in your Windows distro. Here’s how to get it as an object:
$installedNPApps = Get-AppxPackage -AllUsers
Now just call Export-Csv down the pipeline, like so:
$installedNPApps | Export-Csv .\yourcsvfilename.csv
That’s it! You can re-import this csv and iterate through it to create a script that manages all your non-provisioned apps in windows.