<commit_before>$packageName = "mysettings-devvm"

$packages = @(
    "mydev-powershell",
    "mydev-scm",
    "mydev-tools",
    "mydev-nodejs",
    "mydev-python",
    "mydev-database",
    "mydev-visualstudio",
    "mydev-buildtools",
    "mysettings-devenv"
)

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

$devvmpackage = (Get-ChildItem "$($env:ChocolateyInstall)\lib" `
    | Select-Object basename).basename `
    | Where-Object { $_.StartsWith($packageName) }

if ($devvmpackage.Count -gt 1) {
    Write-Warning "This package has already been installed, It is not meant to be used to upgrade..."
    exit
}

if (Test-Path "$env:WINDIR\Setup\Scripts\choco.log") {
    Copy-Item "$env:WINDIR\Setup\Scripts\choco.log" `
        "$env:SYSTEMDRIVE\home\vm\logs\$($env:COMPUTERNAME)-choco.log" -Force
}

if (Test-Path "$env:WINDIR\Setup\Scripts\install.log") {
    Copy-Item "$env:WINDIR\Setup\Scripts\install.log" `
        "$env:SYSTEMDRIVE\home\vm\logs\$($env:COMPUTERNAME)-install.log" -Force
}

if (Test-Path "$env:WINDIR\Setup\Scripts\SetupComplete.log") {
    Copy-Item "$env:WINDIR\Setup\Scripts\SetupComplete.log" `
        "$env:SYSTEMDRIVE\home\vm\logs\$($env:COMPUTERNAME)-SetupComplete.log" -Force
}
    
foreach ($package in $packages) {
    $logFile = "$env:SYSTEMDRIVE\home\vm\logs\$($env:COMPUTERNAME)-$package.log"
    choco.exe install $package -y | Tee-Object -FilePath $logFile
    
    # Now lets check for errors...
    if (Get-Content $logFile | Select-String -Pattern "\[ERROR\]") {
        Write-Warning "An error occurred during the last package ($package) install..."
        Write-Warning "Review the log file: $logFile"
        Write-Warning "And then decide whether to continue..."
        
        Read-Host "Press Enter to continue with next package"
    }
}

Import-Module "${env:USERPROFILE}\Documents\WindowsPowerShell\Modules\go\go.psm1"
Set-Alias -Name go -Value gd

go -Key "etc" -delete
go -Key "etc" -SelectedPath "${env:SYSTEMDRIVE}\etc" -add
go -Key "documents" -delete
go -Key "documents" -SelectedPath "${env:USERPROFILE}\documents" -add
go -Key "docs" -delete
go -Key "docs" -SelectedPath "${env:USERPROFILE}\documents" -add
go -Key "pictures" -delete
go -Key "pictures" -SelectedPath "${env:USERPROFILE}\pictures" -add
go -Key "pics" -delete
go -Key "pics" -SelectedPath "${env:USERPROFILE}\pictures" -add
go -Key "videos" -delete
go -Key "videos" -SelectedPath "${env:USERPROFILE}\videos" -add
go -Key "desktop" -delete
go -Key "desktop" -SelectedPath "${env:USERPROFILE}\desktop" -add
go -Key "downloads" -delete
go -Key "downloads" -SelectedPath "$env:USERPROFILE\downloads" -add
<commit_msg>Updated the check for error to be less specific so that I don't miss any errors.<commit_after>$packageName = "mysettings-devvm"

$packages = @(
    "mydev-powershell",
    "mydev-scm",
    "mydev-tools",
    "mydev-nodejs",
    "mydev-python",
    "mydev-database",
    "mydev-visualstudio",
    "mydev-buildtools",
    "mysettings-devenv"
)

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

$devvmpackage = (Get-ChildItem "$($env:ChocolateyInstall)\lib" `
    | Select-Object basename).basename `
    | Where-Object { $_.StartsWith($packageName) }

if ($devvmpackage.Count -gt 1) {
    Write-Warning "This package has already been installed, It is not meant to be used to upgrade..."
    exit
}

if (Test-Path "$env:WINDIR\Setup\Scripts\choco.log") {
    Copy-Item "$env:WINDIR\Setup\Scripts\choco.log" `
        "$env:SYSTEMDRIVE\home\vm\logs\$($env:COMPUTERNAME)-choco.log" -Force
}

if (Test-Path "$env:WINDIR\Setup\Scripts\install.log") {
    Copy-Item "$env:WINDIR\Setup\Scripts\install.log" `
        "$env:SYSTEMDRIVE\home\vm\logs\$($env:COMPUTERNAME)-install.log" -Force
}

if (Test-Path "$env:WINDIR\Setup\Scripts\SetupComplete.log") {
    Copy-Item "$env:WINDIR\Setup\Scripts\SetupComplete.log" `
        "$env:SYSTEMDRIVE\home\vm\logs\$($env:COMPUTERNAME)-SetupComplete.log" -Force
}
    
foreach ($package in $packages) {
    $logFile = "$env:SYSTEMDRIVE\home\vm\logs\$($env:COMPUTERNAME)-$package.log"
    choco.exe install $package -y | Tee-Object -FilePath $logFile
    
    # Now lets check for errors...
    if (Get-Content $logFile | Select-String -Pattern "Write-Error") {
        Write-Warning "An error occurred during the last package ($package) install..."
        Write-Warning "Review the log file: $logFile"
        Write-Warning "And then decide whether to continue..."
        
        Read-Host "Press Enter to continue with next package"
    }
}

Import-Module "${env:USERPROFILE}\Documents\WindowsPowerShell\Modules\go\go.psm1"
Set-Alias -Name go -Value gd

go -Key "etc" -delete
go -Key "etc" -SelectedPath "${env:SYSTEMDRIVE}\etc" -add
go -Key "documents" -delete
go -Key "documents" -SelectedPath "${env:USERPROFILE}\documents" -add
go -Key "docs" -delete
go -Key "docs" -SelectedPath "${env:USERPROFILE}\documents" -add
go -Key "pictures" -delete
go -Key "pictures" -SelectedPath "${env:USERPROFILE}\pictures" -add
go -Key "pics" -delete
go -Key "pics" -SelectedPath "${env:USERPROFILE}\pictures" -add
go -Key "videos" -delete
go -Key "videos" -SelectedPath "${env:USERPROFILE}\videos" -add
go -Key "desktop" -delete
go -Key "desktop" -SelectedPath "${env:USERPROFILE}\desktop" -add
go -Key "downloads" -delete
go -Key "downloads" -SelectedPath "$env:USERPROFILE\downloads" -add

{'fraction_non_alphanumeric': 0.15845006367109332, 'fraction_numerical': 0.0010915044569765327, 'mean_word_length': 3.6991452991452993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5315477', 'n_tokens_mistral': 1936, 'n_tokens_neox': 1894, 'n_words': 431}