最近准备学习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#就几乎没有,难道是我搜索关键词不对
Chocolatey 有那么一点儿阴间,你要先运行
用管理员身份运行 powershell:
安装一下,然后再按照文档上的,执行
cinst scriptcs
就可以了。推荐使用 Scoop ,直接就可以安装。
官方的 Github 里面还提供了另一种安装方式:
<当前位置>/src/scriptcs/src/scriptcs/bin/Release
添加 PATH 环境变量