使用powershell(版本 5.1.18362.145)并尝试使用Invoke-WebRequest它在使用-SkipCertificateCheck.
我不知道该怎么办,因为它似乎记录在msdn上。我尝试运行Update-Module以防模块是旧版本,但这并没有解决问题。
命令:
iwr -SkipCertificateCheck google.com -UseBasicParsing -Method Head
Run Code Online (Sandbox Code Playgroud)
错误:
Invoke-WebRequest : A parameter cannot be found that matches parameter name 'SkipCertificateCheck'
At line:1 char:5
+ iwr -SkipCertificateCheck google.com -Method Head
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand`
Run Code Online (Sandbox Code Playgroud)
有谁知道如何在Invoke-WebRequest不检查证件的情况下上班吗?
其总体目标是Invoke-WebRequest与具有自签名证书的站点一起使用。
如何在 Go 中将单个字节转换为字节片?
我尝试了几种不同的方法,但没有一个有效。我不断收到错误消息:cannot convert charBytes[i] (type byte) to type []byte。
到目前为止,我找到的唯一工作方法是从字符串中获取字符,将其转换为字符串,然后将其重新转换为字节数组。
characters := "some text"
for i := 0; len(characters); i++ {
var b []byte = []byte(string(characters[i]))
fmt.Println(b)
}
Run Code Online (Sandbox Code Playgroud)