<commit_before>#-----------------------
# PostSysprep.ps1
# This runs as the Jenkins user.
#-----------------------

$ErrorActionPreference='Stop'

echo "$(date) PostSysprep.ps1 started" >> $env:SystemDrive\packer\configure.log

try {
    echo "$(date) PostSysprep.ps1 starting" >> $env:SystemDrive\packer\configure.log    

    #--------------------------------------------------------------------------------------------
    # Set full crashdumps (don't fail if by any chance these fail - eg a different config Azure VM. Set for D3_V2)
    $ErrorActionPreference='SilentlyContinue'
    echo "$(date) PostSysprep.ps1 Enabling full crashdumps..." >> $env:SystemDrive\packer\configure.log    
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v AutoReboot /t REG_DWORD /d 1 /f | Out-Null
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v CrashDumpEnabled /t REG_DWORD /d 1 /f | Out-Null
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v DumpFile /t REG_EXPAND_SZ /d "d:\memory.dmp" /f | Out-Null
    echo "$(date) PostSysprep.ps1 Directing pagefile.sys to C:..." >> $env:SystemDrive\packer\configure.log    
    wmic pagefileset create name="C:\pagefile.sys" 
    echo "$(date) PostSysprep.ps1 Setting pagefile size to 15000..." >> $env:SystemDrive\packer\configure.log    
    wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=15000,MaximumSize=15000
    echo "$(date) PostSysprep.ps1 Removing pagefile from D:..." >> $env:SystemDrive\packer\configure.log    
    wmic pagefileset where name="D:\\pagefile.sys" delete
    $ErrorActionPreference='Stop'
    
    #--------------------------------------------------------------------------------------------
    # Configure the CI Environment
    echo "$(date) PostSysprep.ps1 Configuring the CI environment..." >> $env:SystemDrive\packer\configure.log    
    powershell -command "$env:SystemDrive\packer\ConfigureCIEnvironment.ps1"
<commit_msg>Damn wmic<commit_after>#-----------------------
# PostSysprep.ps1
# This runs as the Jenkins user.
#-----------------------

$ErrorActionPreference='Stop'

echo "$(date) PostSysprep.ps1 started" >> $env:SystemDrive\packer\configure.log

try {
    echo "$(date) PostSysprep.ps1 starting" >> $env:SystemDrive\packer\configure.log    

    #--------------------------------------------------------------------------------------------
    # Set full crashdumps (don't fail if by any chance these fail - eg a different config Azure VM. Set for D3_V2)
    $ErrorActionPreference='SilentlyContinue'
    echo "$(date) PostSysprep.ps1 Enabling full crashdumps..." >> $env:SystemDrive\packer\configure.log    
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v AutoReboot /t REG_DWORD /d 1 /f | Out-Null
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v CrashDumpEnabled /t REG_DWORD /d 1 /f | Out-Null
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v DumpFile /t REG_EXPAND_SZ /d "d:\memory.dmp" /f | Out-Null

    echo "$(date) PostSysprep.ps1 Removing pagefile from D:..." >> $env:SystemDrive\packer\configure.log    
    $pagefile = Get-WmiObject -Query "Select * From Win32_PageFileSetting Where Name='d:\\pagefile.sys'"
    $pagefile.Delete()

    echo "$(date) PostSysprep.ps1 Directing pagefile.sys to C:..." >> $env:SystemDrive\packer\configure.log    
    Set-WMIInstance -class Win32_PageFileSetting -Arguments @{name="c:\pagefile.sys";InitialSize = 15000;MaximumSize = 15000}

    $ErrorActionPreference='Stop'
    
    #--------------------------------------------------------------------------------------------
    # Configure the CI Environment
    echo "$(date) PostSysprep.ps1 Configuring the CI environment..." >> $env:SystemDrive\packer\configure.log    
    powershell -command "$env:SystemDrive\packer\ConfigureCIEnvironment.ps1"

{'fraction_non_alphanumeric': 0.2280747275557862, 'fraction_numerical': 0.01401141670991178, 'mean_word_length': 2.331892826274849, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2441308', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1110, 'n_words': 267}