Skip to content

Instantly share code, notes, and snippets.

@a5ync
Created May 6, 2016 00:27
Show Gist options
  • Save a5ync/986ff17c3e8404bbfc4799bb60e4242d to your computer and use it in GitHub Desktop.
Save a5ync/986ff17c3e8404bbfc4799bb60e4242d to your computer and use it in GitHub Desktop.
List DNX packages installed in system
$path = "c:\Users\"+[Environment]::UserName+"\.dnx\packages"
write-host $path
function GetDirs($path = $pwd, [Byte]$ToDepth = 255, [Byte]$CurrentDepth = 0)
{
$CurrentDepth++
If ($CurrentDepth -le $ToDepth) {
foreach ($item in Get-ChildItem $path)
{
if (Test-Path $item.FullName -PathType Container)
{
"." * $CurrentDepth + $item.FullName
GetDirs $item.FullName -ToDepth $ToDepth -CurrentDepth $CurrentDepth
}
}
}
}
GetDirs -path $path -ToDepth 2 |Out-file ("User"+[Environment]::UserName+".txt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment