-
-
Save anonymous/d4fe7212b5c624bf3b77c35d7f9b48bf to your computer and use it in GitHub Desktop.
INI builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Variable -Exclude PWD,*Preference | Remove-Variable -EA 0 | |
function Start-VPN { | |
if (gwmi Win32_NetworkAdapterConfiguration | Where-Object {($_.Description -ilike "*Cisco Systems*") -and ($_.IpEnabled -eq $False)}){ | |
if ((Get-WmiObject Win32_OperatingSystem).OSArchitecture -eq '64-bit'){ | |
Start-Process 'C:\Program Files (x86)\Cisco Systems\VPN Client\vpnclient.exe' "connect GroupName user UserName pwd pAsS" -EA 0} | |
Else {Start-Process 'C:\Program Files\Cisco Systems\VPN Client\vpnclient.exe' "connect GroupName user UserName pwd pAsS" -EA 0} | |
} | |
} | |
function Set-INI { | |
$xms = "-Xms512M" | |
$xmx = "-Xmx768M" | |
$Drivlet = [System.IO.DriveInfo]::GetDrives() | | |
Where-Object{ | |
$_.DriveType -ne "Network" -and $_.DriveType -ne "CDRom" -and $_.DriveType -ne "DVDRom" -and $_.Name -ne "E:\" | |
} | |
$redac = $Drivelet -replace ':\\','' | |
$Projects = Get-PSDrive -Name $redac | | |
ForEach-Object{Set-Location $_.Root; | |
Get-ChildItem -Recurse -Depth 1 | | |
Where-Object {$_.PSIsContainer} | | |
Where-Object {$_.Name -match "^[0-9]{5,6}[a-zA-Z]?$"} | | |
Sort-Object -Unique | | |
Foreach-Object{ | |
$_.FullName | |
} | |
} | |
$TPS = $Projects | | |
Select-String '[0-9]{5,6}[a-zA-Z]?$' -AllMatches | | |
Sort-Object -Unique | | |
ForEach-Object { | |
$_.Matches } | | |
ForEach-Object{ | |
$_.Value | |
} | |
foreach ($_ in $TPS){ | |
if (!(Test-Path -path "C:\Projects\Cache_Logs\$_")){ | |
New-Item "C:\Projects\cache_logs\$_" -type directory | | |
Out-Null | |
} | |
} | |
$Split = foreach ($_ in $projects){split-path -path $_} | |
$RepSplit = $Split -replace ':\\','_' | |
0..($TPS.Count - 1) | | |
ForEach-Object { | |
$jav += java "$xmx" "$xms" -jar C:\bin\verifier.jar ` | |
$($Projects[$_]) $($TIMS[$_]) ` | |
C:\config\verifier.properties >C:\Projects\Cache_Logs\$($TPS[$_])\$($RepSplit[$_])_$($TPS[$_])_Verifier.log | |
} | |
} | |
Start-VPN; Set-INI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment