Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running script when remoted into another computer Error (Temp Files) #4836

Open
6 tasks done
melas0nos opened this issue Nov 16, 2023 · 1 comment
Open
6 tasks done
Assignees
Labels

Comments

@melas0nos
Copy link

melas0nos commented Nov 16, 2023

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

I am remoted into another computer with Enter-PSSession. I hit F5 to run a .ps1 with any code and it is trying to run on the local machine and/or not running correctly. Getting error:

C:\Users\XXXXX\AppData\Local\Temp\PSES-25588\RemoteFiles\609289779\CORE\scratch.ps1 : The term 
'C:\Users\XXXXX\AppData\Local\Temp\PSES-25588\RemoteFiles\609289779\CORE\scratch.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program.  
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:1
+ C:\Users\XXXXX\AppData\Local\Temp\PSES-25588\RemoteFiles\609289779 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\KTheis...ORE\scratch.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I have tried reinstalling the extension, reinstalling VSCode, and using the preview version of the extension.

This functionality works when I reproduce in Powershell ISE

PowerShell Version

(The following is from the integrated terminal, I am remoted into the "CORE" machine)

[CORE]: PS C:\Users\XXXX\Documents> $PSVersionTable       

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


[CORE]: PS C:\Users\hctech\Documents>

Visual Studio Code Version

1.84.2

Extension Version

v2023.11.0

Steps to Reproduce

Remote into computer:

$so = New-PSSessionOption -SkipCACheck -SkipCNCheck
enter-pssession -ComputerName "CORE" -Credential:'hctech' -UseSSL -SessionOption $so

Then run any code with F5 to get the error.

*** I CAN run the code fine by using F8 running each line independently ***

Visuals

No response

Logs

No response

@melas0nos melas0nos added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Nov 16, 2023
@SydneyhSmith SydneyhSmith added Area-Debugging and removed Needs: Triage Maintainer attention needed! labels Nov 29, 2023
@KlausLadegaard
Copy link

What is status on this one??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Wishlist
Development

No branches or pull requests

4 participants