Build on windows failed for win-setup.ps1
Wireshark version : 3.2.7
OS : Windows
Issue : While building Wireshark code it is observed that wind-setup.ps1 fails with the following reason.
1>-- Building for win64 using Visual Studio 16 2019
1>C:\****\DevWorkarea\Package\****\tools\win-setup.ps1 : Cannot dot-source this command because it was
1>defined in a different language mode. To invoke this command without importing its contents, omit the '.' operator.
1>At line:1 char:1
1>+ . "C:\****\DevWorkarea\Package\****\tools\win-setup.ps1" - ...
I found that this issue is observed because of the policy set on Power Shell to "ConstrainedLanguage". I am required to run the build with this setting, as there is no way to change the setting to "FullLanguage".
Would like to know if I can build win-setup.ps1 with "ConstrainedLanguage" setting.
Thank you in advance
Kiran Kumar G
Some observations:
You may need to ask your management for an exception to their onerous rules if they want you to build Wireshark.
Thanks Graham for your inputs, will try and see if removing portions not required will work. If not will approach admin in our organization to see if they can enable FullLanguage mode.
Thank you.
I overcame this issue by removing the . (dot) operator and execute .ps1 script. Later our admin provided with privilege to run the .ps1 from the powershell with limited access. Now able to proceed further. Thanks for your inputs Graham.