Build on windows failed for win-setup.ps1

asked 2023-10-16 13:23:04 +0000

kirankumarg.81 gravatar image

updated 2023-10-16 14:00:35 +0000

grahamb gravatar image

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

edit retag flag offensive close merge delete

Comments

Some observations:

  1. 3.2.7 is a very old version of Wireshark, but is still available as an installable download.
  2. No attempt has been made to enable the setup script to run in other than FullLanguage mode. You might try to replace the unacceptable portions with equivalents but I suspect this task won't be trivial, if possible at all.

You may need to ask your management for an exception to their onerous rules if they want you to build Wireshark.

grahamb gravatar imagegrahamb ( 2023-10-16 13:58:30 +0000 )edit

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.

kirankumarg.81 gravatar imagekirankumarg.81 ( 2023-10-26 10:56:32 +0000 )edit

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.

kirankumarg.81 gravatar imagekirankumarg.81 ( 2023-12-03 18:43:57 +0000 )edit