Skip to content

Instantly share code, notes, and snippets.

@steviecoaster
Created March 9, 2021 19:39
Show Gist options
  • Save steviecoaster/b4c1691d175ec865c083053c053148d2 to your computer and use it in GitHub Desktop.
Save steviecoaster/b4c1691d175ec865c083053c053148d2 to your computer and use it in GitHub Desktop.
Chocolatey Package Audit Report
choco list -lo --audit -r |
ConvertFrom-Csv -Delimiter '|' -Header Package,Version,InstalledBy,Domain,RequestedBy,InstallDate |
Select Package, Version,
@{Name='InstalledBy';Expression={$_.InstalledBy -replace ('User:','')}},
@{Name='Domain';Expression={$_.Domain -replace ('Domain:','')}},
@{Name='RequestedBy';Expression={$_.RequestedBy -replace ('Original User:','')}},
@{Name='InstallDate';Expression={$_.InstallDate -replace ('InstallDateUtc:','')}} |
ConvertTo-Html -Title "Chocolatey Package Audit" -PreContent "Machine: $env:COMPUTERNAME" > C:\temp\audit.htm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment