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.
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.