Repository: vscode
Issue: shellIntegration.ps1 is not digitally signed
Labels: feature-request,vscode-build,terminal-shell-pwsh

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.75.1
- OS Version: Windows_NT x64 10.0.20348

Steps to Reproduce:

1. Set Execution Policy via GPO to "AllSigned"
2. Start VSCode

This appears since 1.74. I hoped it was just forgotten to sign shellIntegration.ps1, but with current release the issue continues.

We have a company policy to set execution of powershell-scripts via GPO to "AllSigned" so it is not possible to bypass or change the execution-policy on the computer.

We are also monitor this event on our systems which triggers an alert everytime VSCode is started, because of the execution of an unsigned powershell script.

Relevant EventLogs:
```
Error Message = File C:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\browser\media\shellIntegration.ps1 cannot be loaded. The file C:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\browser\media\shellIntegration.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
Fully Qualified Error ID = UnauthorizedAccess
Recommended Action = 


Context:
        Severity = Warning
        Host Name = ConsoleHost
        Host Version = 5.1.20348.643
        Host ID = 50954c61-f870-4707-885a-02d2e38b7fd4
        Host Application = C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command try { . "c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\browser\media\shellIntegration.ps1" } catch {}
        Engine Version = 5.1.20348.643
        Runspace ID = 2bb84ced-b167-4b5e-8c57-ccb090c1fd31
        Pipeline ID = 2
        Command Name = 
        Command Type = 
        Script Name = 
        Command Path = 
        Sequence Number = 15
        User = DOMAIN\USER
        Connected User = 
        Shell ID = Microsoft.PowerShell


User Data:
```

```
Error Message = Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope.  Due to the override, your shell will retain its current effective execution policy of AllSigned. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information please see "Get-Help Set-ExecutionPolicy".
Fully Qualified Error ID = ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
Recommended Action = Contact your system administrator.


Context:
        Severity = Warning
        Host Name = Visual Studio Code Host
        Host Version = 2023.1.0
        Host ID = c5a89ab3-2377-4a74-9319-250218a2387e
        Host Application = C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\USER\.vscode\extensions\ms-vscode.powershell-2023.1.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2023.1.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\USER\.vscode\extensions\ms-vscode.powershell-2023.1.0\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2023.1.0
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Normal' -LogPath 'c:\Users\USER\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1676010691-aed66317-eb79-4c4f-bc78-3b4cd369c81c1676010688614\EditorServices.log' -SessionDetailsPath 'c:\Users\USER\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-4876-818833.json' -FeatureFlags @() 
        Engine Version = 5.1.20348.643
        Runspace ID = b2b4db5d-31d5-49bb-b635-c26b9be5952d
        Pipeline ID = 6
        Command Name = Set-ExecutionPolicy
        Command Type = Cmdlet
        Script Name = 
        Command Path = 
        Sequence Number = 71
        User = DOMAIN\USER
        Connected User = 
        Shell ID = Microsoft.PowerShell


User Data:

```