View Single Post
Old 10-06-2017, 11:12 AM   #35
ermax
Senior Member
 
ermax's Avatar
 
Join Date: Sep 2017
Drives: 2022 BRZ Limited Silver
Location: Jacksonville, FL
Posts: 2,533
Thanks: 883
Thanked 2,049 Times in 1,191 Posts
Mentioned: 68 Post(s)
Tagged: 0 Thread(s)
Here is another handy script I wrote. It runs though all your removable drives looking for one that contains the file logcfg.txt. Once it finds the file it create a new folder named with the date (Ex: 2017-10-06 10.11AM) and moves all the csv files off the removable drive and into this new folder. Once it's done moving the files it then launches your web browser and goes to the datazap upload page, then it launches explorer in the new dated folder so all you have to do then is drag and drop the csv file. Once it's all done it also ejects the removable drive so you are safe to unplug the USB cable from the Tactrix.

The dated folders will be created in the same folder in which you launched the script.

Here is the script:
Copy-Logs.ps1
Code:
foreach ($drive in Get-WmiObject Win32_LogicalDisk | Where-Object {$_.DriveType -eq 2}) {
    If ((Test-Path "$($drive.DeviceID)\logcfg.txt") -and (Test-Path "$($drive.DeviceID)\*.csv")) {
        $OutputPath = ".\$((Get-Date).ToString("yyyy-MM-dd hh.mmtt"))"
        New-Item -Path $OutputPath -Type Directory
        Move-Item -Path "$($drive.DeviceID)\*.csv" -Destination $OutputPath
        
        Start-Process https://datazap.me/upload-csv
        Start-Process $OutputPath
        
        $Eject = New-Object -ComObject Shell.Application
        $Eject.NameSpace(17).ParseName($drive.DeviceID).InvokeVerb("Eject")
    }
}

Start-Sleep 2
My next project will be to add something like this under the dash:
https://www.amazon.com/female-panel-...G89MRDVZTMV492
ermax is offline   Reply With Quote