Created
May 6, 2016 00:27
-
-
Save a5ync/986ff17c3e8404bbfc4799bb60e4242d to your computer and use it in GitHub Desktop.
List DNX packages installed in system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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