当试图运行试图从NuGet网站下载内容的脚本时,我收到以下错误:
Preparing to run build script...
Unable to find version '0.30.0' of package 'Cake'.
C:\Users\user\.nuget\packages\: Package 'Cake.0.30.0' is not found on source 'C:\Users\user\.nuget\packages\'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'Cake.0.30.0' is not found on source 'C:\Program Files (
x86)\Microsoft SDKs\NuGetPackages\'.
https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The remote name could not be resolved: '[proxyname]'
An error occurred while restoring NuGet tools.
At C:\Users\user\Documents\location\build.ps1:168 char:9
+ Throw "An error occurred while restoring NuGet tools."
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (An error occurr...ng NuGet tools.:String) [], RuntimeException
+ FullyQualifiedErrorId : An error occurred while restoring NuGet tools.
请注意,我已使用[proxyname]替换了代理名称。这个错误很奇怪的原因是我将Internet选项设置为自动检测而不使用代理。代理仅适用于我的工作。有没有办法阻止PowerShell尝试使用代理?