Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Invoke WebRequest正在解码我的url,但仅在PowerShell中解码(不是ISE)_Powershell - Fatal编程技术网

Invoke WebRequest正在解码我的url,但仅在PowerShell中解码(不是ISE)

Invoke WebRequest正在解码我的url,但仅在PowerShell中解码(不是ISE),powershell,Powershell,当我在PowerShell中运行此命令时,ISE工作得非常好。当我在PowerShell中运行它时,它会解码URL。有人知道怎么避开这个吗 调用webrequest-urihttps://machinename/DirectoryServices/list/c%3A%5Cinetpub -冗长的 ISE的结果是有效载荷成功。但在PowerShell中,我收到以下错误消息—请注意url中的c:\inetpub—不知何故,它已从编码版本转换为解码版本: VERBOSE: GET https://ma

当我在PowerShell中运行此命令时,ISE工作得非常好。当我在PowerShell中运行它时,它会解码URL。有人知道怎么避开这个吗

调用webrequest-urihttps://machinename/DirectoryServices/list/c%3A%5Cinetpub -冗长的

ISE的结果是有效载荷成功。但在PowerShell中,我收到以下错误消息—请注意url中的c:\inetpub—不知何故,它已从编码版本转换为解码版本:

VERBOSE: GET https://machinename/DirectoryServices/list/c:/inetpub with 0-byte payload
invoke-webrequest : The remote server returned an error: (404) Not Found.
At line:1 char:1
+ invoke-webrequest -uri https://hmachinename/Director ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

在我的机器上,我看到来自ISE和Powershell的
invoke webrequest-uri的HTTP404错误https://example.org/c%3A%5Cinetpub -详细信息
-详细信息在它们中的编码方式不同(ps=>
VERBOSE:GEThttps://example.org/c:\具有0字节负载的inetpub,ise=>
VERBOSE:GEThttps://example.org/c:%5Cinetpub 使用0字节的有效负载,但如果运行Fiddler,您将看到它们都使用
GET命中相同的urihttps://example.org/c%3A%5Cinetpub HTTP/1.1