Skip to content

Commit

Permalink
Add script to list chocolatey dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lackovic committed Jan 5, 2021
1 parent 02a2fab commit 59970f6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Windows/Chocolatey/cdeps.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$packages = Get-ChildItem C:\ProgramData\chocolatey\lib\ -Recurse *.nuspec | select fullname,name
foreach($p in $packages){
[XML]$xml=get-content $p.fullname
$dependencies = $xml.package.metadata.dependencies.dependency
foreach($d in $dependencies){
$obj = New-Object -TypeName psobject
$obj | Add-Member -MemberType NoteProperty -name package -Value $xml.package.metadata.id
$obj | Add-Member -MemberType NoteProperty -name packageversion -Value $xml.package.metadata.version
$obj | Add-Member -MemberType NoteProperty -name dependency -Value $d.id
$obj | Add-Member -MemberType NoteProperty -name dependencyversion -Value $d.version
$obj
}
}

0 comments on commit 59970f6

Please sign in to comment.