問題タブ [invoke-webrequest]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
0 に答える
151 参照

azure - PowerShellのURIにパラメーターとして日付を渡すことができません

PowerShell と REST API ( https://consumption.azure.com/v3/enrollments/ {enrollmentNumber}/usagedetailsbycustomdate?startTime=2017-01-01&endTime=を使用して、Azure サブスクリプションの使用状況の詳細を JSON 形式で取得しようとしています。 2017-01-10)

日付の実際の値をパラメーターとして使用すると、コードが機能します。しかし、変数を使用して現在および前日の日付を取得すると、機能しません。値が 2014-05-01 より小さいというエラーをスローしています

このコードを使用して、過去 2 日間の使用状況の詳細を取得しようとしています。ヘルプやアドバイスをいただければ幸いです

0 投票する
1 に答える
1197 参照

forms - pwsh の新しい param -form を使用して Web サイトにサインインする方法

PowerShell 6.2.1 は、Invoke-WebRequest を使用して Forms プロパティを返しません。Powershell 5で行っていた方法:


Microsoft のドキュメントには、-Form使用できるパラメーターがあることがわかりますが、数時間ハッキングしてきましたが、ほとんど成功していません。

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-6

彼らは2つの可能な解決策を提供しました。

例 1


例 2

私は両方を試しましたが、現在のコード ブロックは 2 つの組み合わせであり、少なくとも十分な失敗が得られます。

これは私が今得ているエラーです。

Invoke-WebRequest :

403禁止します

禁止 このサーバーの /login にアクセスする権限がありません。

行:7 文字:11

  • $result = Invoke-WebRequest 'https://www.podbean.com/login' -SessionV ...
  • CategoryInfo : InvalidOperation: (Method: POST, Reque\u2026tent-Length: 357 }:HttpRequestMessage) [Invoke-WebRequest], HttpResponseException
  • FullyQualifiedErrorId : WebCmdletWebResponseException、Microsoft.PowerShell.Commands.InvokeWebRequestCommand

これは実際に私が得た最高の応答です。