[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-post-ja-powershell-purokushi-gaido":3},{"success":4,"payload":5,"related":72,"errors":134},true,{"id":6,"slug":7,"title":8,"excerpt":9,"body_html":10,"meta_title":11,"meta_description":12,"canonical_url":13,"canonical_override":14,"og_title":11,"og_description":15,"og_image_url":16,"faq_json":17,"key_takeaways":33,"allow_index":4,"noindex_google_only":39,"allow_follow":4,"published_at":40,"updated_at":40,"content_updated_at":41,"featured_image_url":42,"featured_image_alt":43,"card_image_url":44,"reading_time_minutes":45,"author":46,"categories":50,"tags":57,"alternates":58,"locale_paths":67,"views":71},136,"powershell-purokushi-gaido","PowerShellでプロキシを使用する完全ガイド：Invoke-WebRequestとInvoke-RestMethod","PowerShellのInvoke-WebRequestとInvoke-RestMethodでプロキシを設定する方法を、地理位置情報・スティッキーセッション・リトライ処理まで含めて解説。レジデンシャルプロキシの実践的なコード例を網羅します。","\u003Cp>PowerShellでWebスクレイピングやAPI呼び出しを行う際、データセンタIPがブロックされて困った経験はありませんか？ PowerShellでプロキシを使用する方法を正しく理解すれば、Invoke-WebRequestやInvoke-RestMethodで安定したデータ収集が可能になります。本記事では、ProxyHatのレジデンシャルプロキシをPowerShellから活用するための実践的なコード例を5つ以上紹介します。\u003C\u002Fp>\n\n\u003Ch2>PowerShellでプロキシを使用する：なぜデータセンタIPがブロックされるのか\u003C\u002Fh2>\n\n\u003Cp>AWSやAzureなどのクラウドプロバイダが持つIPレンジは公開されており、多くのWebサイトはこれらのレンジからのアクセスを自動的に制限します。たとえば、\u003Ca href=\"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fpowershell\u002Fmodule\u002Fmicrosoft.powershell.utility\u002Finvoke-webrequest?view=powershell-7.6\" rel=\"noopener noreferrer\">MicrosoftのInvoke-WebRequestドキュメント\u003C\u002Fa>に記載されている通り、PowerShellのHTTP要求はデフォルトでシステムのプロキシ設定を継承しますが、クラウド環境で実行している場合はそもそもIP自体がブロック対象になります。\u003C\u002Fp>\n\n\u003Cp>\u003Ca href=\"\u002Fja\u002Fproxy\u002Fresidential\">レジデンシャルプロキシ\u003C\u002Fa>は、実際のISP（インターネットサービスプロバイダ）に割り当てられたIPアドレスを中継するため、対象サイトからは一般ユーザのアクセスとして認識されます。これにより、データセンタIPでは到達できないエンドポイントにアクセスできるようになります。\u003C\u002Fp>\n\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\u003Cth>プロキシタイプ\u003C\u002Fth>\u003Cth>検出リスク\u003C\u002Fth>\u003Cth>適した用途\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>データセンタプロキシ\u003C\u002Ftd>\u003Ctd>高（IPレンジが公開されている）\u003C\u002Ftd>\u003Ctd>制限の緩いAPI、社内システム\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>レジデンシャルプロキシ\u003C\u002Ftd>\u003Ctd>低（ISP IPを中継）\u003C\u002Ftd>\u003Ctd>SERPスクレイピング、価格監視\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>モバイルプロキシ\u003C\u002Ftd>\u003Ctd>最低（キャリアIP）\u003C\u002Ftd>\u003Ctd>高度な反ボット対策サイト\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Ch2>Invoke-WebRequestとInvoke-RestMethodの組み込みプロキシ機能\u003C\u002Fh2>\n\n\u003Cp>PowerShellの\u003Ccode>Invoke-WebRequest\u003C\u002Fcode>と\u003Ccode>Invoke-RestMethod\u003C\u002Fcode>には、プロキシを指定するための組み込みパラメータが用意されています。最もシンプルな形式は\u003Ccode>-Proxy\u003C\u002Fcode>パラメータと\u003Ccode>-ProxyCredential\u003C\u002Fcode>パラメータの組み合わせです。\u003C\u002Fp>\n\n\u003Ch3>基本的なプロキシ設定\u003C\u002Fh3>\n\n\u003Cpre>\u003Ccode># 基本的なプロキシ認証付きリクエスト\n$proxyUrl = &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos;\n$proxyCred = Get-Credential\n\n$response = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fip&apos; `\n    -Proxy $proxyUrl `\n    -ProxyCredential $proxyCred\n\nWrite-Host $response.Content\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>\u003Ccode>Get-Credential\u003C\u002Fcode>を実行すると資格情報入力ダイアログが表示されます。ユーザ名にProxyHatのユーザ名、パスワードにパスワードを入力してください。スクリプトで自動化する場合は、資格情報を事前にPSCredentialオブジェクトとして作成します。\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># 資格情報をスクリプト内で構築（対話ダイアログなし）\n$username = &apos;your-proxyhat-username&apos;\n$password = &apos;your-proxyhat-password&apos;\n$securePassword = ConvertTo-SecureString $password -AsPlainText -Force\n$proxyCred = New-Object System.Management.Automation.PSCredential($username, $securePassword)\n\n$response = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fip&apos; `\n    -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; `\n    -ProxyCredential $proxyCred\n\n$response.Content\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>\u003Ccode>-ProxyUseDefaultCredentials\u003C\u002Fcode>スイッチを使用すると、現在のWindows認証資格情報をプロキシ認証に流用できますが、ProxyHatのような外部サービスでは独自の認証情報が必要なため、基本的には\u003Ccode>-ProxyCredential\u003C\u002Fcode>を明示的に指定してください。\u003C\u002Fp>\n\n\u003Ch2>PSCredentialで地理位置情報とスティッキーセッションをエンコード\u003C\u002Fh2>\n\n\u003Cp>ProxyHatでは、ユーザ名にフラグを埋め込むことで地理位置情報の指定やスティッキーセッションの利用が可能です。これにより、特定の国や都市からのアクセスを模倣したり、同一IPを維持したりできます。\u003C\u002Fp>\n\n\u003Ch3>国指定と都市指定\u003C\u002Fh3>\n\n\u003Cpre>\u003Ccode># 米国のIPを使用\n$geoUser = &apos;user-country-US&apos;\n$securePass = ConvertTo-SecureString &apos;your-password&apos; -AsPlainText -Force\n$geoCred = New-Object System.Management.Automation.PSCredential($geoUser, $securePass)\n\n$resp = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fip&apos; `\n    -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; `\n    -ProxyCredential $geoCred\n\n# ドイツ・ベルリンのIPを使用\n$geoUser = &apos;user-country-DE-region-state_of_berlin-city-berlin&apos;\n$geoCred = New-Object System.Management.Automation.PSCredential($geoUser, $securePass)\n\n$resp = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fip&apos; `\n    -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; `\n    -ProxyCredential $geoCred\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>スティッキーセッションで同一IPを維持\u003C\u002Fh3>\n\n\u003Cpre>\u003Ccode># スティッキーセッション：同一IPを維持してログイン状態を保持\n$sessionUser = &apos;user-sid-abc123&apos;\n$sessionCred = New-Object System.Management.Automation.PSCredential($sessionUser, $securePass)\n\n# 同一セッションIDで複数リクエスト → 同一IPからアクセス\n$resp1 = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fip&apos; `\n    -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; -ProxyCredential $sessionCred\n\n$resp2 = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fheaders&apos; `\n    -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; -ProxyCredential $sessionCred\n\n# 両方のレスポンスで同じIPが返される\nWrite-Host &quot;Request 1: $($resp1.Content)&quot;\nWrite-Host &quot;Request 2: $($resp2.Content)&quot;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>System.Net.WebProxyでより細かい制御\u003C\u002Fh3>\n\n\u003Cp>HttpClientレベルでプロキシを制御したい場合は、\u003Ccode>System.Net.WebProxy\u003C\u002Fcode>オブジェクトを構築して\u003Ccode>Invoke-WebRequest\u003C\u002Fcode>の\u003Ccode>-Proxy\u003C\u002Fcode>に渡すことも可能です。\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># WebProxyオブジェクトで詳細制御\n$proxy = New-Object System.Net.WebProxy(&apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos;, $true)\n$proxy.Credentials = New-Object System.Net.NetworkCredential(&apos;user-country-US&apos;, &apos;your-password&apos;)\n\n# HttpClientHandlerに設定して.NETクラスから直接利用\n$handler = New-Object System.Net.Http.HttpClientHandler\n$handler.Proxy = $proxy\n$handler.UseProxy = $true\n\n$client = New-Object System.Net.Http.HttpClient($handler)\n$response = $client.GetAsync(&apos;https:\u002F\u002Fhttpbin.org\u002Fip&apos;).Result\nWrite-Host $response.Content.ReadAsStringAsync().Result\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>WebRequestSessionでCookieとヘッダーを保持\u003C\u002Fh2>\n\n\u003Cp>ログインが必要なサイトや、複数ページにまたがるスクレイピングでは、Cookieとヘッダーをリクエスト間で保持する必要があります。PowerShellでは\u003Ccode>-SessionVariable\u003C\u002Fcode>と\u003Ccode>-WebSession\u003C\u002Fcode>パラメータを使ってこれを実現します。\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># セッション変数でCookieとヘッダーを保持\n$proxyCred = New-Object System.Management.Automation.PSCredential(\n    &apos;user-country-US&apos;, \n    (ConvertTo-SecureString &apos;your-password&apos; -AsPlainText -Force)\n)\n\n# 最初のリクエストでセッションを確立\n$null = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fcookies\u002Fset?token=abc123&apos; `\n    -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; ` -ProxyCredential $proxyCred `\n    -SessionVariable session `\n    -UserAgent &apos;Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36&apos;\n\n# 同じセッションで後続リクエスト → Cookieが自動的に送信される\n$resp = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fcookies&apos; `\n    -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; ` -ProxyCredential $proxyCred `\n    -WebSession $session `\n    -UserAgent &apos;Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36&apos;\n\nWrite-Host $resp.Content\n# {&quot;cookies&quot;: {&quot;token&quot;: &quot;abc123&quot;}}\n\n# カスタムヘッダーの追加\n$session.Headers.Add(&apos;X-Custom-Header&apos;, &apos;ProxyHat-Scrape&apos;)\n$session.Headers.Add(&apos;Accept-Language&apos;, &apos;en-US,en;q=0.9&apos;)\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>\u003Ccode>-UserAgent\u003C\u002Fcode>を明示的に設定することで、デフォルトのPowerShellユーザエージェント文字列による検出を回避できます。これはPowerShell Webスクレイピングにおいて最も見落とされがちなポイントの一つです。\u003C\u002Fp>\n\n\u003Ch2>レジデンシャルプロキシでブロックを回避する実践例\u003C\u002Fh2>\n\n\u003Cp>ここまでの要素を組み合わせて、JSON APIをページングしながらデータを収集し、セッションをローテーションし、リトライとバックオフを実装する実践的な例を示します。\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># ページングAPIスクレイピング：セッションローテーション＋リトライ\n$baseUrl = &apos;https:\u002F\u002Fapi.example.com\u002Fitems&apos;\n$maxPages = 50\n$maxRetries = 3\n$retryInterval = 5  # 秒\n$results = @()\n\nfor ($page = 1; $page -le $maxPages; $page++) {\n    # ページごとに新しいセッションIDを生成してIPをローテーション\n    $sessionId = &quot;sess-$([System.Guid]::NewGuid().ToString(&apos;N&apos;).Substring(0,8))&quot;\n    $proxyUser = &quot;user-country-US-sid-$sessionId&quot;\n    $proxyCred = New-Object System.Management.Automation.PSCredential(\n        $proxyUser,\n        (ConvertTo-SecureString &apos;your-password&apos; -AsPlainText -Force)\n    )\n\n    $uri = &quot;$baseUrl`?page=$page&amp;limit=100&quot;\n    $retryCount = 0\n    $success = $false\n\n    while (-not $success -and $retryCount -lt $maxRetries) {\n        try {\n            $resp = Invoke-RestMethod -Uri $uri `\n                -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; ` -ProxyCredential $proxyCred `\n                -MaximumRetryCount $maxRetries ` -RetryIntervalSec $retryInterval `\n                -Headers @{ &apos;Accept&apos; = &apos;application\u002Fjson&apos;; &apos;Accept-Language&apos; = &apos;en-US&apos; } `\n                -UserAgent &apos;Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64)&apos;\n\n            $results += $resp.data\n            $success = $true\n            Write-Host &quot;Page $page: $($resp.data.Count) items retrieved&quot;\n        }\n        catch {\n            $retryCount++\n            $statusCode = $_.Exception.Response.StatusCode.value__\n            Write-Warning &quot;Page $page failed (HTTP $statusCode), retry $retryCount\u002F$maxRetries&quot;\n            if ($retryCount -ge $maxRetries) {\n                Write-Error &quot;Page $page exceeded max retries: $_&quot;\n            }\n            Start-Sleep -Seconds ($retryInterval * $retryCount)  # 指数バックオフ\n        }\n    }\n\n    # リクエスト間隔（礼儀正しいスクレイピング）\n    Start-Sleep -Milliseconds 500\n}\n\nWrite-Host &quot;Total items collected: $($results.Count)&quot;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>この例では、\u003Ccode>-MaximumRetryCount\u003C\u002Fcode>と\u003Ccode>-RetryIntervalSec\u003C\u002Fcode>を組み込みのパラメータとして使用し、さらに\u003Ccode>try\u002Fcatch\u003C\u002Fcode>で指数バックオフを実装しています。ページごとに新しいセッションIDを生成することで、IPをローテーションしながらレート制限を回避します。\u003C\u002Fp>\n\n\u003Ch2>本番環境向けのヒント\u003C\u002Fh2>\n\n\u003Ch3>環境変数でプロキシを設定\u003C\u002Fh3>\n\n\u003Cp>子プロセスや.NET HttpClientを使用するツールでは、環境変数\u003Ccode>$env:HTTPS_PROXY\u003C\u002Fcode>と\u003Ccode>$env:HTTP_PROXY\u003C\u002Fcode>を設定することで、すべてのHTTP要求にプロキシを適用できます。\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># 環境変数でプロキシを設定（子プロセスにも継承）\n$env:HTTP_PROXY = &apos;http:\u002F\u002Fuser-country-US:your-password@gate.proxyhat.com:8080&apos;\n$env:HTTPS_PROXY = &apos;http:\u002F\u002Fuser-country-US:your-password@gate.proxyhat.com:8080&apos;\n\n# 以降のリクエストは自動的にプロキシを使用\n$response = Invoke-WebRequest -Uri &apos;https:\u002F\u002Fhttpbin.org\u002Fip&apos;\nWrite-Host $response.Content\n\n# 子プロセス（curlなど）にも継承される\ncurl.exe https:\u002F\u002Fhttpbin.org\u002Fip\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>TLS設定の明示\u003C\u002Fh3>\n\n\u003Cp>Windows PowerShell 5.1では、デフォルトでTLS 1.0が使用されることがあり、モダンなAPIとの通信に失敗することがあります。\u003Ca href=\"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fapi\u002Fsystem.net.servicepointmanager.securityprotocol?view=net-10.0\" rel=\"noopener noreferrer\">MicrosoftのServicePointManagerドキュメント\u003C\u002Fa>に記載の通り、TLS 1.2以上を明示的に指定してください。\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># TLS 1.2を強制（Windows PowerShell 5.1向け）\n[Net.ServicePointManager]::SecurityProtocol = `\n    [Net.SecurityProtocolType]::Tls12 -bor `\n    [Net.SecurityProtocolType]::Tls13\n\n# PowerShell 7以降では不要（.NET Core が自動的に最新TLSを選択）\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>PowerShell 7のForEach-Object -Parallelで並行スクレイピング\u003C\u002Fh3>\n\n\u003Cpre>\u003Ccode># PowerShell 7以降：並行リクエストでスループット向上\n$urls = 1..20 | ForEach-Object { &quot;https:\u002F\u002Fhttpbin.org\u002Fip?page=$_&quot; }\n\n$results = $urls | ForEach-Object -Parallel {\n    $proxyUser = &quot;user-country-US-sid-para$($_.Substring(30,6))&quot;\n    $proxyCred = New-Object System.Management.Automation.PSCredential(\n        $proxyUser,\n        (ConvertTo-SecureString &apos;your-password&apos; -AsPlainText -Force)\n    )\n    try {\n        $resp = Invoke-WebRequest -Uri $_ `\n            -Proxy &apos;http:\u002F\u002Fgate.proxyhat.com:8080&apos; ` -ProxyCredential $proxyCred `\n            -TimeoutSec 15 -UseBasicParsing\n        [PSCustomObject]@{ Url = $_; Status = $resp.StatusCode; Content = $resp.Content }\n    }\n    catch {\n        [PSCustomObject]@{ Url = $_; Status = &apos;Error&apos;; Content = $_.Exception.Message }\n    }\n} -ThrottleLimit 10\n\n$results | Format-Table -AutoSize\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>\u003Ccode>-ThrottleLimit 10\u003C\u002Fcode>で最大10の並行リクエストを制御できます。プロキシプロバイダの同時接続制限（ProxyHatでは100セッション以上の同時接続が可能）を超えないよう調整してください。\u003C\u002Fp>\n\n\u003Ch2>倫理と法的な考慮事項\u003C\u002Fh2>\n\n\u003Cp>スクレイピングを行う際は、以下の点に注意してください。\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>\u003Cstrong>公開データのみを対象とする：\u003C\u002Fstrong> ログイン背後のデータや、明示的にアクセスが制限されているコンテンツは収集しないでください。\u003C\u002Fli>\n\u003Cli>robots.txtを尊重する： 対象サイトの\u003Ccode>robots.txt\u003C\u002Fcode>を確認し、スクレイピングが許可されているパスのみにアクセスしてください。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>米国のCFAA：\u003C\u002Fstrong> コンピュータ不正使用法（CFAA）に違反する可能性のあるアクセスは避けてください。詳細はFTCのCFAA概要を参照してください。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>EUのGDPR：\u003C\u002Fstrong> 個人データを含むコンテンツの収集・処理は、GDPRの要件に従う必要があります。詳細は\u003Ca href=\"https:\u002F\u002Fcommission.europa.eu\u002Flaw\u002Flaw-topic\u002Fdata-protection_en\" rel=\"noopener noreferrer\">欧州委員会のデータ保護ページ\u003C\u002Fa>を参照してください。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>公式APIを優先：\u003C\u002Fstrong> 対象サービスが公式APIを提供している場合は、スクレイピングの前にAPIの利用を検討してください。APIの方が安定性が高く、法的リスクも低くなります。\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>ProxyHatのプロキシをPowerShellで活用する準備ができたら、\u003Ca href=\"\u002Fja\u002Fpricing\">プラン一覧\u003C\u002Fa>から最適なプランを選択するか、\u003Ca href=\"https:\u002F\u002Fdocs.proxyhat.com\u002F\" rel=\"noopener noreferrer\">ProxyHat公式ドキュメント\u003C\u002Fa>で接続詳細を確認してください。SERP追跡やWebスクレイピングのユースケースについては、それぞれ\u003Ca href=\"\u002Fja\u002Fuse-cases\u002Fserp-tracking\">SERP追跡\u003C\u002Fa>と\u003Ca href=\"\u002Fja\u002Fuse-cases\u002Fweb-scraping\">Webスクレイピング\u003C\u002Fa>のページも参照してください。利用可能なロケーションは\u003Ca href=\"\u002Fja\u002Flocations\">プロキシロケーション一覧\u003C\u002Fa>で確認できます。\u003C\u002Fp>","PowerShellでプロキシを使用する完全ガイド | ProxyHat","PowerShellでプロキシを使用する方法を解説。Invoke-WebRequestとInvoke-RestMethodのプロキシ設定、地理位置情報、スティッキーセッション、リトライ処理まで実践的なコード例を網羅。","\u002Fja\u002Fblog\u002Fpowershell-purokushi-gaido",null,"PowerShellでプロキシを使用する方法を解説。Invoke-WebRequestとInvoke-RestMethodのプロキシ設定、リトライ処理、並行スクレイピングまで実践的なコード例を網羅。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fpowershell-purokushi-gaido-og.webp",[18,21,24,27,30],{"question":19,"answer":20},"PowerShellでプロキシを使用するとはどういう意味ですか？","PowerShellでプロキシを使用するとは、Invoke-WebRequestやInvoke-RestMethodコマンドレットの-Proxyパラメータと-ProxyCredentialパラメータを利用して、HTTPリクエストをプロキシサーバ経由で送信することを指します。これにより、実際のIPアドレスを隠蔽し、地理位置情報を変更したり、IPブロックを回避したりできます。",{"question":22,"answer":23},"PowerShellでプロキシを使用することがプロキシユーザにとってなぜ重要ですか？","PowerShellスクリプトから直接プロキシを利用できることで、Webスクレイピング、API呼び出し、自動化タスクにおいてデータセンタIPのブロックを回避できます。また、ユーザ名にフラグを埋め込むことで、コードを変更せずに国や都市の指定、スティッキーセッションの制御が可能になり、運用効率が大幅に向上します。",{"question":25,"answer":26},"PowerShellでプロキシを使用する場合、どのプロキシタイプが最適ですか？","ブロックされやすいWebサイトやSERPにアクセスする場合はレジデンシャルプロキシが最適です。レジデンシャルプロキシは実際のISPに割り当てられたIPを中継するため、対象サイトからは一般ユーザとして認識されます。データセンタプロキシは制限の緩いAPIや社内システム向けで、モバイルプロキシは高度な反ボット対策があるサイトに適しています。",{"question":28,"answer":29},"PowerShellでプロキシを使用する際にブロックを回避するにはどうすればよいですか？","ブロックを回避するには、レジデンシャルプロキシを使用し、リクエストごとにセッションIDを変更してIPをローテーションします。また、-UserAgentでブラウザのユーザエージェント文字列を設定し、-SessionVariableでCookieを保持し、-MaximumRetryCountと-RetryIntervalSecでリトライとバックオフを実装してください。リクエスト間隔を適切に空けることも重要です。",{"question":31,"answer":32},"PowerShellでプロキシ認証情報をスクリプト内で安全に扱うにはどうすればよいですか？","ConvertTo-SecureStringでパスワードをSecureStringに変換し、New-Object System.Management.Automation.PSCredentialでPSCredentialオブジェクトを構築します。本番環境では、資格情報を環境変数やAzure Key Vaultなどのシークレット管理サービスに格納し、スクリプト内にハードコードしないでください。PowerShell 7ではSecretManagementモジュールの利用も推奨されます。",[34,35,36,37,38],"Invoke-WebRequestやInvoke-RestMethodで-Proxyと-ProxyCredentialを指定し、レジデンシャルプロキシ経由でデータセンタIPのブロックを回避できます。","プロキシのユーザ名に「user-country-US」や「user-sid-abc123」などのフラグを埋め込むことで、位置情報の指定とスティッキーセッションを制御できます。","-SessionVariableと-WebSessionパラメータを使用してCookieやヘッダーを保持し、ログイン状態を維持したまま複数ページのスクレイピングが可能です。","ページごとにセッションIDを変更してIPをローテーションし、try\u002Fcatch内でリトライと指数バックオフを実装することで信頼性が向上します。","本番環境ではTLS 1.2以上の明示的設定や環境変数によるプロキシ指定、ForEach-Object -Parallelを活用して効率的かつ安全なスクレイピングを行います。",false,"2026-07-02T10:05:41+00:00","2026-10-04T02:42:19+00:00","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fpowershell-purokushi-gaido-master.webp","Using Proxies in PowerShell: A Code-First Guide to Invoke-WebRequest & Invoke-RestMethod","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fpowershell-purokushi-gaido-card.webp",12,{"name":47,"slug":48,"bio":49,"avatar_url":14,"website_url":14,"social_links":14},"ProxyHat Team","proxyhat-team","The ProxyHat editorial team covers proxies, web scraping, and data extraction.",[51],{"id":52,"slug":53,"name":54,"description":14,"meta_title":55,"meta_description":56,"parent_id":14},4,"kaihatsusha-gaido","開発者ガイド","開発者ガイド | ProxyHat ブログ","プロキシをアプリケーションに統合するためのコードチュートリアルとSDKガイド。",[],{"fr":59,"ru":60,"en":61,"pt":62,"es":63,"tr":64,"ja":13,"zh":65,"ko":66,"x-default":61},"\u002Ffr\u002Fblog\u002Futiliser-proxies-powershell-invoke-webrequest","\u002Fru\u002Fblog\u002Fispolzovanie-proksi-v-powershell","\u002Fblog\u002Fusing-proxies-in-powershell","\u002Fpt\u002Fblog\u002Fusar-proxies-no-powershell","\u002Fes\u002Fblog\u002Fusar-proxies-en-powershell-guia","\u002Ftr\u002Fblog\u002Fpowershell-proxy-kullanimi","\u002Fcn\u002Fblog\u002Fpowershell-daili-shiyong-zhinan","\u002Fko\u002Fblog\u002Fpowershell-proxy-sayong-gaide",{"fr":59,"ru":60,"pl":68,"en":61,"it":69,"pt":62,"es":63,"tr":64,"ja":13,"zh":65,"de":70,"ko":66},"\u002Fpl\u002Fblog\u002Fuzywanie-proxy-w-powershell","\u002Fit\u002Fblog\u002Fusare-proxy-in-powershell","\u002Fde\u002Fblog\u002Fproxys-in-powershell-verwenden",233,[73,88,103,119],{"id":74,"slug":75,"title":76,"excerpt":77,"featured_image_url":78,"featured_image_alt":79,"card_image_url":80,"og_image_url":81,"published_at":82,"updated_at":82,"content_updated_at":83,"reading_time_minutes":45,"is_featured":39,"indexable":4,"views":6,"author":84,"categories":85,"tags":87},176,"got-scraping-nodejs-purokishi","Node.jsでgot-scrapingを使ったプロキシ連携の完全ガイド","got-scrapingのheader-generatorとProxyHatレジデンシャルプロキシを組み合わせ、Node.jsでブロックされないスクレイピングを構築する方法を解説。実践的なコード例付き。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fgot-scraping-nodejs-purokishi-master.webp","got-scraping in Node.js: A Developer's Guide with Residential Proxies","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fgot-scraping-nodejs-purokishi-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fgot-scraping-nodejs-purokishi-og.webp","2026-08-04T16:05:06+00:00","2026-10-03T08:57:49+00:00",{"name":47,"slug":48,"bio":49,"avatar_url":14,"website_url":14,"social_links":14},[86],{"id":52,"slug":53,"name":54,"description":14,"meta_title":55,"meta_description":56,"parent_id":14},[],{"id":89,"slug":90,"title":91,"excerpt":92,"featured_image_url":93,"featured_image_alt":94,"card_image_url":95,"og_image_url":96,"published_at":97,"updated_at":97,"content_updated_at":83,"reading_time_minutes":45,"is_featured":39,"indexable":39,"views":98,"author":99,"categories":100,"tags":102},175,"colly-purokushi-roteshon-gaido","Collyでのローテーティングプロキシ完全ガイド: Goスクレイパーの本番運用","Collyでのローテーティングプロキシの実装方法を解説。RoundRobinProxySwitcherとカスタムプロキシ関数でResidentialプロキシをリクエストごとに切り替え、ブロック回避と高スループットを実現する実践的なGoコード例を提供します。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fcolly-purokushi-roteshon-gaido-master.webp","Rotating Proxies in Colly: A Framework-Idiomatic Guide for Go Developers","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fcolly-purokushi-roteshon-gaido-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fcolly-purokushi-roteshon-gaido-og.webp","2026-08-04T10:05:34+00:00",86,{"name":47,"slug":48,"bio":49,"avatar_url":14,"website_url":14,"social_links":14},[101],{"id":52,"slug":53,"name":54,"description":14,"meta_title":55,"meta_description":56,"parent_id":14},[],{"id":104,"slug":105,"title":106,"excerpt":107,"featured_image_url":108,"featured_image_alt":109,"card_image_url":110,"og_image_url":111,"published_at":112,"updated_at":112,"content_updated_at":113,"reading_time_minutes":45,"is_featured":39,"indexable":4,"views":114,"author":115,"categories":116,"tags":118},195,"bybit-v5-market-api-proxy-scraping","暗号資産取引所の市場データをローテーションプロキシで収集する完全ガイド（Bybit V5 APIの例）","Bybit V5 Market APIのorderbook・tickers・klineエンドポイントをローテーションプロキシ経由でスクレイピングする方法を、Node.js・Pythonのコード例とともに解説。レート制限・地域制限の回避策もカバーします。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbybit-v5-market-api-proxy-scraping-master.webp","How to Scrape the Bybit V5 Market API with Rotating Proxies","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbybit-v5-market-api-proxy-scraping-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbybit-v5-market-api-proxy-scraping-og.webp","2026-08-03T16:09:16+00:00","2026-11-17T10:13:54+00:00",121,{"name":47,"slug":48,"bio":49,"avatar_url":14,"website_url":14,"social_links":14},[117],{"id":52,"slug":53,"name":54,"description":14,"meta_title":55,"meta_description":56,"parent_id":14},[],{"id":120,"slug":121,"title":122,"excerpt":123,"featured_image_url":124,"featured_image_alt":125,"card_image_url":126,"og_image_url":127,"published_at":128,"updated_at":128,"content_updated_at":129,"reading_time_minutes":45,"is_featured":39,"indexable":39,"views":114,"author":130,"categories":131,"tags":133},194,"binance-api-scraping-proxy","Binance REST APIをプロキシでスクレイピングする完全ガイド","Binanceの公開マーケットデータREST APIをプロキシ経由で大規模収集する方法を、エンドポイント別のウェイト制限、IPローテーション、リトライ戦略まで含めて解説します。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbinance-api-scraping-proxy-master.webp","How to Scrape the Binance REST API with Proxies: A Developer Guide","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbinance-api-scraping-proxy-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbinance-api-scraping-proxy-og.webp","2026-08-03T10:04:04+00:00","2026-10-03T08:21:25+00:00",{"name":47,"slug":48,"bio":49,"avatar_url":14,"website_url":14,"social_links":14},[132],{"id":52,"slug":53,"name":54,"description":14,"meta_title":55,"meta_description":56,"parent_id":14},[],[]]