<commit_before># bootstrap DNVM into this session.
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}

# load up the global.json so we can find the DNX version
$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore

if($globalJson)
{
    $dnxVersion = $globalJson.sdk.version
}

if([string]::IsNullOrEmpty($dnxVersion))
{
    Write-Warning "Unable to locate global.json to determine using 'latest'"
    $dnxVersion = "latest"
}

# install DNX
# only installs the default (x86, clr) runtime of the framework.
# If you need additional architectures or runtimes you should add additional calls
# ex: & $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -r coreclr
Write-Host "Bootstrapping DNX version: $dnxVersion"
& $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -p

 # run DNU restore on all project.json files in the src folder including 2>1 to redirect stderr to stdout for badly behaved tools
Set-Location $PSScriptRoot
Get-ChildItem -Path @('src', 'test') -Filter project.json -Recurse -Depth 2 | ForEach-Object { & dnu restore $_.FullName 2>1 }<commit_msg>Added custom function since recursion isn't supported<commit_after># bootstrap DNVM into this session.
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}

# load up the global.json so we can find the DNX version
$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore

if($globalJson)
{
    $dnxVersion = $globalJson.sdk.version
}

if([string]::IsNullOrEmpty($dnxVersion))
{
    Write-Warning "Unable to locate global.json to determine using 'latest'"
    $dnxVersion = "latest"
}

# install DNX
# only installs the default (x86, clr) runtime of the framework.
# If you need additional architectures or runtimes you should add additional calls
# ex: & $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -r coreclr
Write-Host "Bootstrapping DNX version: $dnxVersion"
& $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -p

# Add custom max depth function here
function Get-MyChildItem
{
  param
  (
    [Parameter(Mandatory = $true)]
    $Path,
    
    $Filter = '*',
    
    [System.Int32]
    $MaxDepth = 3,
    
    [System.Int32]
    $Depth = 0
  )
  
  $Depth++

  Get-ChildItem -Path $Path -Filter $Filter -File 
  
  if ($Depth -le $MaxDepth)
  {
    Get-ChildItem -Path $Path -Directory |
      ForEach-Object { Get-MyChildItem -Path $_.FullName -Filter $Filter -Depth $Depth -MaxDepth $MaxDepth}
  }
  
}

 # run DNU restore on all project.json files in the src folder including 2>1 to redirect stderr to stdout for badly behaved tools
Set-Location $PSScriptRoot
Get-MyChildItem -Path @('src', 'test') -Filter project.json -MaxDepth 2 | ForEach-Object { & dnu restore $_.FullName 2>1 }
{'fraction_non_alphanumeric': 0.1152027027027027, 'fraction_numerical': 0.007432432432432433, 'mean_word_length': 4.140625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '446521', 'n_tokens_mistral': 986, 'n_tokens_neox': 947, 'n_words': 293}