<commit_before>$packageName = "posh-pester"
$version = "3.3.11"
$url = "https://codeload.github.com/pester/Pester/zip/$version"
$appDir = "$($env:UserProfile)\Documents\WindowsPowerShell\Modules\pester"
$downloadPath = "$env:TEMP\chocolatey\$packageName"

if ($psISE) {
    Import-Module -name "$env:ChocolateyInstall\chocolateyinstall\helpers\chocolateyInstaller.psm1"
}

Get-ChocolateyWebFile $packageName "$downloadPath\$version.zip" $url
Get-ChocolateyUnzip "$downloadPath\$version.zip" "$downloadPath\"

if (Test-Path $appDir)
{
  Write-Output "Removing previous version of package..."
  Remove-Item "$($appDir)" -Recurse -Force
}

if (-not (Test-Path $downloadPath))
{
    New-Item -Type Directory -Path $downloadPath | Out-Null
}

$source = "$downloadPath\Pester-$version"
New-Item -Type Directory -Path $appDir | Out-Null

Copy-Item -Path "$source\Pester.ps*" -Destination "$appDir"
New-Item -Type Directory -Path "$appDir\en-US" | Out-Null
Copy-Item -Path "$source\en-US\*" -Destination "$appDir\en-US"
New-Item -Type Directory -Path "$appDir\Functions" | Out-Null
Copy-Item -Path "$source\Functions\*" -Destination "$appDir\Functions" -Recurse<commit_msg>need to create download directory prior to trying to download the file.<commit_after>$packageName = "posh-pester"
$version = "3.3.11"
$url = "https://codeload.github.com/pester/Pester/zip/$version"
$appDir = "$($env:UserProfile)\Documents\WindowsPowerShell\Modules\pester"
$downloadPath = "$env:TEMP\chocolatey\$packageName"

if ($psISE) {
    Import-Module -name "$env:ChocolateyInstall\chocolateyinstall\helpers\chocolateyInstaller.psm1"
}

if (-not (Test-Path $downloadPath))
{
    New-Item -Type Directory -Path $downloadPath | Out-Null
}

Get-ChocolateyWebFile $packageName "$downloadPath\$version.zip" $url
Get-ChocolateyUnzip "$downloadPath\$version.zip" "$downloadPath\"

if (Test-Path $appDir)
{
  Write-Output "Removing previous version of package..."
  Remove-Item "$($appDir)" -Recurse -Force
}

$source = "$downloadPath\Pester-$version"
New-Item -Type Directory -Path $appDir | Out-Null

Copy-Item -Path "$source\Pester.ps*" -Destination "$appDir"
New-Item -Type Directory -Path "$appDir\en-US" | Out-Null
Copy-Item -Path "$source\en-US\*" -Destination "$appDir\en-US"
New-Item -Type Directory -Path "$appDir\Functions" | Out-Null
Copy-Item -Path "$source\Functions\*" -Destination "$appDir\Functions" -Recurse
{'fraction_non_alphanumeric': 0.1637353433835846, 'fraction_numerical': 0.0041876046901172526, 'mean_word_length': 4.92803970223325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4902562', 'n_tokens_mistral': 824, 'n_tokens_neox': 809, 'n_words': 172}