Attempting to run Powershell Tools on Visual Studio Code produces error

The following error is produced trying to load Powershell Tools in VS Code. Help!

PS C:\Users\a6363> Import-Module ‘c:\Users\me.vscode\extensions\ironmansoftware.powershellprotools-5.7.0\out\PowerShellProTools.VSCode.psd1’ -ArgumentList @($true)
Import-Module : File C:\Users\me.vscode\extensions\ironmansoftware.powershellprotools-5.7.0\out\modules\PowerShellProTools\PowerShellProTools.psm1 cannot be
loaded because its operation is blocked by software restriction policies, such as those created by using Group Policy.
At line:1 char:1

  • Import-Module 'c:\Users\me.vscode\extensions\ironmansoftware.powe …
  •   + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand

Can you run Get-ExecutionPolicy to see what your current environment has it set to?

Adam, here is the execution policy on the computer

image001.png

Regards,

Scott

Could you please upgrade to 5.3.1 and see if it solves your issue?

Okay. MS Code and PSP Tools have been upgraded to the latest release but now when it attempts to load I get a licensing error. This computer has a trial license on it that expired over the weekend but yesterday I purchased a license and
when I enter my new license code it fails.

image001.png

PS C:\Users\a6363> Import-Module ‘c:\Users\a6363.vscode\extensions\ironmansoftware.powershellprotools-5.7.1\out\PowerShellProTools.VSCode.psd1’ -ArgumentList @($true)

Starting server with PSScriptRoot: C:\Users\a6363.vscode\extensions\ironmansoftware.powershellprotools-5.7.1\out

PS C:\Users\a6363> Importing PowerShell Pro Tools module.

Importing PowerShell Pro Tools for VS Code module.

Starting server with PSScriptRoot: C:\Users\a6363.vscode\extensions\ironmansoftware.powershellprotools-5.7.1\out

PoshProTools runspace already exists. Not starting server.

Starting named pipe server.

Received command:

Exception in server: System.IO.IOException: Pipe is broken.

at System.IO.Pipes.NamedPipeServerStream.CheckConnectOperationsServer()

at System.IO.Pipes.NamedPipeServerStream.WaitForConnection()

at PowerShellToolsPro.Cmdlets.VSCodeHelpers.StartServer(String psScriptRoot)

Received command: Install-PoshProToolsLicense -License ‘redacted’ -StoreInMemory

Output is not null. Writing output (98 bytes).

Received command: Get-PoshProToolsLicense | ForEach-Object { [PSCustomObject]@{ UserName = _.UserName; EndDate = .EndDate.ToString(); IsTrial = $.IsTrial; Status =

$_.Status.ToString() } } | ConvertTo-Json

Output is not null. Writing output (98 bytes).

Received command: Install-PoshProToolsLicense -License ‘redacted’ | Out-Null; Install-PoshProToolsLicense -License ‘redacted’ -StoreInMemory | Out-Null; Get-PoshProToolsLicense | ConvertTo-Json

Output is not null. Writing output (98 bytes).

1 Like

Can you try to clear our the license.lic file and activation.lic file in %AppData%\PowerShell Pro Tools and reapply the license to see if that works around this issue.

I attempted to activate your license on my machine and it worked so the key appears valid but there must be some state that I’m not reproducing at the moment. I’ll continue to test on my end to see if I can reproduce it. If this doesn’t work for you, I’m happy to jump on a call to help sort this.

Adam, clearing the .lic file did the trick. Thanks for your help and so far I am really liking Powershell Pro Tools. Keep up the good work!

Regards,

Scott

1 Like

Same Error here with the Version 5.8.5. Delete of the files in %AppData% didn’t solved the Problem.
Could you help me to solve the Problem?

Regards
Angelo

Can you email me with your license info? adam@poshtools.com I’d like to provide you with an offline license to try.

Thanks,
Adam

Problem still there in Version 5.10. Is there something new for a solution?

Thanks Angelo

I have also had this issue for a while now. I am showing licensed in a PowerShell console but VScode says I’m not. I’ve tried clearing out the License file in %AppData% and when prompted to install new license it fails. “Failed to install PowerShell Pro Tools license.”

@noahpeltier - Can you please email me as well with your order ID?