Files
bodyshop-uploader/BodyshopUploader/Utils/Scripts/ArmsExport.ps1
2022-02-07 13:31:51 -08:00

39 lines
1.0 KiB
PowerShell

#Verify that the partner is running. If not, strat it.
if((Get-Process -Name ImEXOnlinePartner -ErrorAction SilentlyContinue) -eq $null){
& "$Env:USERPROFILE\AppData\Local\ImEXOnlinePartner\ImEXOnlinePartner.exe"
}
$PSversion = $PSVersionTable.PSVersion.Major
function v2 {
# Post request to the partner to trigger the export.
Invoke-WebRequest -Uri http://localhost:1337/arms/rodata/ -Method POST
#Start the Arms Uploader.
#Start-Process -FilePath "C:\ImEX\Applications\ARMSUploader\ROUpload.exe"
}
function v1 {
WebRequest = [System.Net.WebRequest]::Create("http://localhost:1337/arms/rodata/")
WebRequest.Method = "POST"
WebRequest.ContentType = "application/json"
Response = $WebRequest.GetResponse()
ResponseStream = $Response.GetResponseStream()
ReadStream = New-Object System.IO.StreamReader $ResponseStream
#Data=$ReadStream.ReadToEnd()
#Start the Arms Uploader.
Start-Process -FilePath "C:\ImEX\Applications\ARMSUploader\ROUpload.exe"
}
Switch ($PSversion) {
1 {v1}
2 {v1}
4 {v2}
5 {v2}
6 {v2}
7 {v2}
}