为何安装scriptcs失败?

最近准备学习C#,准备C#环境,安装scriptcs工具时,官方推荐chocolatey安装,显示了相关错误

ERROR: The term 'Write-ChocolateyFailure' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The install of scriptcs was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\ScriptCs\tools\chocolateyInstall.ps1'.
 See log for details.

找来找去网上关于相关介绍都很少,想着,干脆直接下载scriptcs,但是他官网提供的包好像是源码呀,不支持直接安装,虽然知道国内C#的相关资料比Java上,网上一搜Java安装一大把,C#就几乎没有,难道是我搜索关键词不对

http://scriptcs.net/

阅读 4.2k
2 个回答

Chocolatey 有那么一点儿阴间,你要先运行
用管理员身份运行 powershell:

choco install chocolatey-compatibility.extension

安装一下,然后再按照文档上的,执行 cinst scriptcs 就可以了。


推荐使用 Scoop ,直接就可以安装。

scoop install scriptcs

image.png


官方的 Github 里面还提供了另一种安装方式:

image.png

  • 克隆或者下载这个仓库
  • 运行 build.cmd
  • <当前位置>/src/scriptcs/src/scriptcs/bin/Release 添加 PATH 环境变量
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进