HTMLソースを取得2

SMPS_Exe( "Invoke-RestMethod -Method GET -Uri '{URL}'")

エラーになる場合:[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; を追加

Invoke-RestMethod : 要求は中止されました: SSL/TLS のセキュリティで保護されているチャネルを作成できませんでした。

SMPS_Exe( "

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;

Invoke-RestMethod -Method GET -Uri '{URL}'

")

エラーを取得したい場合:

SMPS_Exe( "$ERROR.Clear(); Invoke-RestMethod -Method GET -Uri '{URL}'; $ERROR[0]; ")