<commit_before><# script to setup git, hub, and vscode with common settings and extensions
to download and execute script:
(new-object net.webclient).downloadFile("https://raw.githubusercontent.com/jagilber/powershellScripts/master/git-vscode-setup.ps1", "$pwd/git-vscode-setup.ps1");
.\git-vscode-setup.ps1
#>

param(
    [string]$gitHubDir = "c:\github",
    [string[]]$additionalExtensions = @('shan.code-settings-sync',
        'msazurermtools.azurerm-vscode-tools',
        'eamodio.gitlens',
        'wengerk.highlight-bad-chars',
        'rsbondi.highlight-words',
        'sandcastle.vscode-open',
        'mechatroner.rainbow-csv',
        'grapeCity.gc-excelviewer',
        'ms-vscode.csharp',
        'ms-vscode.powershell'),
    [string]$user,
    [string]$email,
    [string]$binPath = "c:\program files\git"
)

[io.directory]::CreateDirectory($gitHubDir)
if(!(test-path "$pwd\download-git-client.ps1")) {
    (new-object net.webclient).downloadFile("https://raw.githubusercontent.com/jagilber/powershellScripts/master/download-git-client.ps1", "$pwd/download-git-client.ps1");
}

$error.Clear()

if(!$user){
 $user = [regex]::Match((whoami /fqdn),"CN=(.+?),").Groups[1].Value
}

if($error){
    $error.Clear()
    $user = $env:USERNAME
}

if(!$email){
    $email = (whoami /upn)
}

if($error){
    $error.Clear()
    $email = "$env:USERNAME@$env:userdomain"
}

# git
$error.clear()
(git)|out-null

if($error) {    
    .\download-git-client.ps1
}

# git config
git config --global user.name $user
git config --global user.email $email
git config --global core.editor "code --wait"

# hub git wrapper
$error.clear()
(hub)|out-null

if($error) {
    .\download-git-client.ps1 -hub -setpath -destPath 
}

Set-Location $gitHubDir

$error.clear()
(code /?)|out-null

if($error) {
    (new-object net.webclient).downloadFile("https://raw.githubusercontent.com/PowerShell/vscode-powershell/master/scripts/Install-VSCode.ps1", "$pwd/Install-VSCode.ps1");
    .\Install-VSCode.ps1 -additionalExtensions @($additionalExtensions) -launchWhenDone -enableContextMenus
}<commit_msg>change for git download<commit_after><# script to setup git, hub, and vscode with common settings and extensions
to download and execute script:
(new-object net.webclient).downloadFile("https://raw.githubusercontent.com/jagilber/powershellScripts/master/git-vscode-setup.ps1", "$pwd/git-vscode-setup.ps1");
.\git-vscode-setup.ps1
#>

param(
    [string]$gitHubDir = "c:\github",
    [string[]]$additionalExtensions = @('shan.code-settings-sync',
        'msazurermtools.azurerm-vscode-tools',
        'eamodio.gitlens',
        'wengerk.highlight-bad-chars',
        'rsbondi.highlight-words',
        'sandcastle.vscode-open',
        'mechatroner.rainbow-csv',
        'grapeCity.gc-excelviewer',
        'ms-vscode.csharp',
        'ms-vscode.powershell'),
    [string]$user,
    [string]$email
)

[io.directory]::CreateDirectory($gitHubDir)
if(!(test-path "$pwd\download-git-client.ps1")) {
    (new-object net.webclient).downloadFile("https://raw.githubusercontent.com/jagilber/powershellScripts/master/download-git-client.ps1", "$pwd/download-git-client.ps1");
}

$error.Clear()

if(!$user){
 $user = [regex]::Match((whoami /fqdn),"CN=(.+?),").Groups[1].Value
}

if($error){
    $error.Clear()
    $user = $env:USERNAME
}

if(!$email){
    $email = (whoami /upn)
}

if($error){
    $error.Clear()
    $email = "$env:USERNAME@$env:userdomain"
}

# git
$error.clear()
(git)|out-null

if($error) {    
    .\download-git-client.ps1
}

# git config
git config --global user.name $user
git config --global user.email $email
git config --global core.editor "code --wait"

# hub git wrapper
$error.clear()
(hub)|out-null

if($error) {
    .\download-git-client.ps1 -hub -setpath
}

Set-Location $gitHubDir

$error.clear()
(code /?)|out-null

if($error) {
    (new-object net.webclient).downloadFile("https://raw.githubusercontent.com/PowerShell/vscode-powershell/master/scripts/Install-VSCode.ps1", "$pwd/Install-VSCode.ps1");
    .\Install-VSCode.ps1 -additionalExtensions @($additionalExtensions) -launchWhenDone -enableContextMenus
}
{'fraction_non_alphanumeric': 0.18139873725109276, 'fraction_numerical': 0.005828071879553181, 'mean_word_length': 3.9094159713945174, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 19, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3996405', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1497, 'n_words': 221}