简体   繁体   English

r 标志对更新包有什么作用

[英]What does the r flag do for update-package

Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r

What does the r flag do? r标志有什么作用? I would guess reinstall, but I can't find this documented anywhere.我猜想重新安装,但我在任何地方都找不到这个文档。 The official documentation doesn't appear to mention it anywhere, but I have seen it suggested to be used in a few other answers. 官方文档似乎没有在任何地方提及它,但我已经看到它建议用于其他一些答案。

The docs for the Update-Package only lists a single parameter starting with the letter r . Update-Package的文档仅列出了一个以字母r开头的参数。 PowerShell only requires you to specify arguments to the point that it's not ambiguous, hence -r , -re , -rei , -rein , -reins , -reinst , -reinsta , -reinstal and -reinstall all are equivalent. PowerShell 只要求您指定 arguments 以使其不模糊,因此-r-re-rei-rein-reins-reinst-reinsta-reinstal-reinstall都是等效的。

On the other hand, there is more than one argument starting with i , hence -i will not work, it's necessary to provide at least enough letters until it's no longer ambiguous.另一方面,以i开头的参数不止一个,因此-i不起作用,必须提供至少足够的字母,直到不再模棱两可。

This is the reason that the single letter arguments are not documented.这就是没有记录单个字母 arguments 的原因。 PowerShell works differently to Unix commands, and Update-Package doesn't itself explicitly support the single letter argument. PowerShell 与 Unix 命令的工作方式不同,并且 Update-Package 本身并不明确支持单字母参数。 It's just the shell that auto-fills on behalf of the user.它只是代表用户自动填充的 shell。

So, yes, it reinstalls.所以,是的,它重新安装。 Note that reinstall doesn't do anything for PackageReference, only for pacakges.config.请注意,重新安装不会对 PackageReference 执行任何操作,仅对 pacakges.config 执行任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM