mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-02-14 07:48:37 +01:00
Fix licensing servers tests
This commit is contained in:
parent
b5ba36c033
commit
9e6f386819
2 changed files with 12 additions and 22 deletions
|
@ -865,26 +865,21 @@ ipconfig /flushdns %nul%
|
||||||
set "tls=[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;"
|
set "tls=[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;"
|
||||||
|
|
||||||
for %%# in (
|
for %%# in (
|
||||||
|
licensing.mp.microsoft.com/v7.0/licenses/content
|
||||||
login.live.com/ppsecure/deviceaddcredential.srf
|
login.live.com/ppsecure/deviceaddcredential.srf
|
||||||
purchase.mp.microsoft.com/v7.0/users/me/orders
|
purchase.mp.microsoft.com/v7.0/users/me/orders
|
||||||
) do if not defined resfail (
|
) do if not defined resfail (
|
||||||
set "d1=Add-Type -AssemblyName System.Net.Http;"
|
%psc% "try { !tls! irm https://%%# -Method POST } catch { if ($_.Exception.Response -eq $null) { exit 3 } }"
|
||||||
set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();"
|
if !errorlevel!==3 (
|
||||||
set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();"
|
echo:
|
||||||
set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()"
|
set resfail=1
|
||||||
%psc% "!tls! !d1!" %nul2% | findstr /i "PurchaseFD DeviceAddResponse" %nul1% || set resfail=1
|
%psc% "try { !tls! irm https://%%# -Method POST } catch { Write-Host """"[%%#] $($_.Exception.Message)"""" -ForegroundColor Red -BackgroundColor Black }"
|
||||||
if defined resfail %psc% "!tls! !d1!"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined resfail (
|
|
||||||
%psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST" | find /i "traceId" %nul1% || set resfail=1
|
|
||||||
if defined resfail %psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST"
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined resfail (
|
if defined resfail (
|
||||||
set error=1
|
set error=1
|
||||||
echo:
|
|
||||||
for %%# in (
|
for %%# in (
|
||||||
login.live.com
|
login.live.com
|
||||||
purchase.mp.microsoft.com
|
purchase.mp.microsoft.com
|
||||||
|
|
|
@ -628,26 +628,21 @@ ipconfig /flushdns %nul%
|
||||||
set "tls=[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;"
|
set "tls=[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;"
|
||||||
|
|
||||||
for %%# in (
|
for %%# in (
|
||||||
|
licensing.mp.microsoft.com/v7.0/licenses/content
|
||||||
login.live.com/ppsecure/deviceaddcredential.srf
|
login.live.com/ppsecure/deviceaddcredential.srf
|
||||||
purchase.mp.microsoft.com/v7.0/users/me/orders
|
purchase.mp.microsoft.com/v7.0/users/me/orders
|
||||||
) do if not defined resfail (
|
) do if not defined resfail (
|
||||||
set "d1=Add-Type -AssemblyName System.Net.Http;"
|
%psc% "try { !tls! irm https://%%# -Method POST } catch { if ($_.Exception.Response -eq $null) { exit 3 } }"
|
||||||
set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();"
|
if !errorlevel!==3 (
|
||||||
set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();"
|
echo:
|
||||||
set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()"
|
set resfail=1
|
||||||
%psc% "!tls! !d1!" %nul2% | findstr /i "PurchaseFD DeviceAddResponse" %nul1% || set resfail=1
|
%psc% "try { !tls! irm https://%%# -Method POST } catch { Write-Host """"[%%#] $($_.Exception.Message)"""" -ForegroundColor Red -BackgroundColor Black }"
|
||||||
if defined resfail %psc% "!tls! !d1!"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined resfail (
|
|
||||||
%psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST" | find /i "traceId" %nul1% || set resfail=1
|
|
||||||
if defined resfail %psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST"
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined resfail (
|
if defined resfail (
|
||||||
set error=1
|
set error=1
|
||||||
echo:
|
|
||||||
for %%# in (
|
for %%# in (
|
||||||
login.live.com
|
login.live.com
|
||||||
purchase.mp.microsoft.com
|
purchase.mp.microsoft.com
|
||||||
|
|
Loading…
Add table
Reference in a new issue