Files
bodyshop-uploader/BodyshopUploader/Utils/Scripts/PaintScaleExport.ps1
2023-02-24 15:51:37 -08:00

34 lines
872 B
PowerShell

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