NatLee / telepy

A Django-based web application for managing and monitoring the reverse SSH tunnels or jump servers.
MIT License
6 stars 1 forks source link

[BUG] powershell script error #32

Closed NatLee closed 5 months ago

NatLee commented 6 months ago

觀察連線狀況發現這個問題

image

然後code裡面長這樣 怕

image

SSH保持連線是不會有回傳值(卡在執行中)

這邊必須修正😢😢😢

NatLee commented 6 months ago

一樓的問題並非目前版本的錯誤 目前版本有另外一個錯誤,稍候補圖

NatLee commented 6 months ago

目前腳本會遇到這個問題

(base) PS C:\Users\nat.lee> C:\Users\nat.lee\Desktop\start.ps1
[+] Script start
Add-Type : c:\Users\nat.lee\AppData\Local\Temp\wf1qvpa3\wf1qvpa3.0.cs(3) : 類別、結構或介面成員宣告中無效的語彙基元 '{'
c:\Users\nat.lee\AppData\Local\Temp\wf1qvpa3\wf1qvpa3.0.cs(2) : using System.Runtime.InteropServices;
c:\Users\nat.lee\AppData\Local\Temp\wf1qvpa3\wf1qvpa3.0.cs(3) : >>> public static class PowerManageme
nt {{
c:\Users\nat.lee\AppData\Local\Temp\wf1qvpa3\wf1qvpa3.0.cs(4) :     [DllImport("kernel32.dll", CharSe
t = CharSet.Auto, SetLastError = true)]
位於 C:\Users\nat.lee\Desktop\start.ps1:20 字元:1
+ Add-Type -TypeDefinition @"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Power...peCompilerError:AddTypeCompilerError)  
   [Add-Type],Exception
    + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

Add-Type : c:\Users\nat.lee\AppData\Local\Temp\wf1qvpa3\wf1qvpa3.0.cs(9) : 必須是類型或命名空間定義,或檔案結尾
c:\Users\nat.lee\AppData\Local\Temp\wf1qvpa3\wf1qvpa3.0.cs(8) :     public const uint ES_DISPLAY_REQU
IRED = 0x00000002;
c:\Users\nat.lee\AppData\Local\Temp\wf1qvpa3\wf1qvpa3.0.cs(9) : >>> }}
位於 C:\Users\nat.lee\Desktop\start.ps1:20 字元:1
+ Add-Type -TypeDefinition @"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Power...peCompilerError:AddTypeCompilerError)  
   [Add-Type],Exception
    + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

Add-Type : 無法新增類型。發生編譯錯誤。
位於 C:\Users\nat.lee\Desktop\start.ps1:20 字元:1
+ Add-Type -TypeDefinition @"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Add-Type],InvalidOperationException
    + FullyQualifiedErrorId : COMPILER_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand