我在 powershell 脚本中有以下评论:
\n\n#ERROR: Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.\n#EXPLANATION: PowerShell calls uses TLS 1.0 for web requests by default. \n# However, Exchange is expecting a higher level of TLS, so you need to tell PowerShell to use 1.2 instead of the default of TLS 1.0\n\xe2\x80\x8b#SOLUTION(s): \n# [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\nRun Code Online (Sandbox Code Playgroud)\n\n当我运行脚本时,我收到此错误:
\n\ns : The term 's' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the\nspelling of the name, or if a path was included, verify that the path is correct and try again.\nAt ps1:4 char:14\n+ \xc3\xa2\xe2\x82\xac\xe2\x80\xb9#SOLUTION(s):\n+ ~\n + CategoryInfo : ObjectNotFound: (s:String) [], CommandNotFoundException\n + FullyQualifiedErrorId : CommandNotFoundException\nRun Code Online (Sandbox Code Playgroud)\n\n为什么要抱怨评论?
\n\n如果我删除它然后抱怨解决方案本身......
\n您已将其发布在错误日志中:+ \xc3\xa2\xe2\x82\xac\xe2\x80\xb9#SOLUTION(s):
#SOLUTION(s): 左侧的代码中的之前有一个空字符,因此它正在将该行读入 powershell。只需删除该行\xe2\x80\x8b#SOLUTION(s):并重新输入即可。
要检查将行复制并粘贴到 powershell 控制台中,应按如下所示读出:
\n\n\n| 归档时间: |
|
| 查看次数: |
492 次 |
| 最近记录: |