NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

Warn when Powershell language mode is not full language #3326

Open zhili1208 opened 8 years ago

zhili1208 commented 8 years ago

https://github.com/NuGet/Home/issues/3312

In bug 3312, Since we don't have clear warning message for powershell language mode, we wasted a lot of time to investigate that issue.

In our current code, we only check execution policy, but language mode also will impact script running. ConstrainedLanguage Exposes a subset of the PowerShell language that limits itself to core PowerShell types, does not support method invocation (except on those types), and does not support property setters (except on those types).

FullLanguage Commands that contain any Windows PowerShell language elements are allowed. This field is introduced in Windows PowerShell 2.0.

NoLanguage Only commands that are using the System.Management.Automation.Runspaces functionality are allowed. This field is introduced in Windows PowerShell 2.0.

RestrictedLanguage Commands that contain scripts that need to be evaluated are not allowed.

So if the language mode is not full language, the customer might can't run script. In this case, we should warn.

rrelyea commented 8 years ago

Sounds good. Please address this in dev branch

rrelyea commented 8 years ago

Let's not target 3.5-rtm, as time is short. Just 3.6 b1.