Skip to content

Commit 409f1b7

Browse files
authored
fix(codecatalyst): remote connect may fail from Windows #3817
Problem: When connecting to a dev environment using "Open Dev Environment" from a Windows user _who has not run Explorer or Edge at least once_, vscode remote-ssh may get stuck: "Setting up SSH Host (details) Initializing VS Code Server" "kex_exchange_identification: Connection closed by remote host Connection closed by UNKNOWN port 65535" #3810 Solution: Specify the `-UseBasicParsing` option. `Invoke-WebRequest` can fail for Windows users if IE/Edge have never been run, because of missing capabilities to parse the HTTP response. If IE/Edge were not run at least once, Windows does not initialize some libraries needed in powershell. https://stackoverflow.com/a/38054505/152142 https://learn.microsoft.com/en-us/previous-versions/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest?view=powershell-3.0#-usebasicparsing > This parameter is required when Internet Explorer is not installed on the computers, such as on > a Server Core installation of a Windows Server operating system. Helped-by: Jan Weßling <[email protected]>
1 parent 9811946 commit 409f1b7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "CodeCatalyst: \"Open CodeCatalyst Dev Environment\" may fail to connect from a new Windows system"
4+
}

resources/codecatalyst_connect.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function StartDevEnvironmentSession {
6868
}
6969
"@
7070

71-
$webRequest = Invoke-WebRequest -Method 'PUT' -Uri "$Endpoint$startSessionPath" -Headers @{"Content-Type" = "application/json"; "Authorization" = "Bearer $Token" } -Body "$startSessionQuery"
71+
$webRequest = Invoke-WebRequest -Method 'PUT' -Uri "$Endpoint$startSessionPath" -Headers @{"Content-Type" = "application/json"; "Authorization" = "Bearer $Token" } -Body "$startSessionQuery" -UseBasicParsing
7272
ConvertFrom-Json -InputObject $webRequest
7373
}
7474

0 commit comments

Comments
 (0)