Skip to content

Commit

Permalink
Add powershell demo
Browse files Browse the repository at this point in the history
Doeesn't work due to debugger crashing on stack trace request.

Related #69
  • Loading branch information
puremourning committed Nov 2, 2019
1 parent c420295 commit cf44cae
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 1 deletion.
29 changes: 28 additions & 1 deletion install_gadget.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,32 @@
},
},
},
'PowerShellEditorServices': {
'language': 'powershell',
'enabled': False,
'download': {
'url': 'https://github.com/PowerShell/PowerShellEditorServices/releases/'
'download/v${version}/PowerShellEditorServices.zip',
'format': 'zip',
},
'do': ( lambda name, root:
MakeSymlink( gadget_dir,
name,
os.path.join( root, 'PowerShellEditorServices' ) ) ),
'all': {
'version': '1.13.0',
'file_name': 'PowerShellEditorServices.zip',
'checksum':
'd10bda5c7d36795bb8f860b2d09a637f8f98ee401c60ac4c40a636f8606565b9'
},
'adapters': {
'PowerShell': {
'name': 'PowerShell',
'type': 'PowerShell',
'port': 'ask',
},
},
}
}


Expand Down Expand Up @@ -453,7 +479,8 @@ def extract( self, member, path = None, pwd = None ):

ret_val = self._extract_member( member, path, pwd )
attr = member.external_attr >> 16
os.chmod( ret_val, attr )
if attr:
os.chmod( ret_val, attr )
return ret_val


Expand Down
17 changes: 17 additions & 0 deletions support/test/powershell/.vimspector.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"configurations": {
"launch": {
"adapter": "PowerShell",
"configuration": {
"request": "launch",
"Script": "${file}",
"NoDebug": false,
"StopOnEntry": true,
"Args": [],
"Cwd": "${workspaceRoot}",
"CreateTemporaryIntegratedConsole": true,
"Env": {}
}
}
}
}
6 changes: 6 additions & 0 deletions support/test/powershell/connect
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

PIPE=$(python -c 'import json; print( json.load( open( "session.json" ))["debugServicePipeName"] )')

ssh -L 4321:$PIPE localhost

18 changes: 18 additions & 0 deletions support/test/powershell/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

PSES_BUNDLE_PATH=$HOME/.vim/bundle/vimspector/gadgets/macos/PowerShellEditorServices
SESSION_TEMP_PATH=$(pwd)

pwsh -NoProfile \
-Command \
"$PSES_BUNDLE_PATH/PowerShellEditorServices/Start-EditorServices.ps1 \
-BundledModulesPath $PSES_BUNDLE_PATH \
-LogPath $SESSION_TEMP_PATH/logs.log \
-SessionDetailsPath $SESSION_TEMP_PATH/session.json \
-FeatureFlags @() \
-AdditionalModules @() \
-HostName 'My Client' \
-HostProfileId 'myclient' \
-HostVersion 1.0.0 \
-EnableConsoleRepl \
-LogLevel Verbose"
9 changes: 9 additions & 0 deletions support/test/powershell/test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo "HELLO"
echo "HELLO"
echo "HELLO"
echo "HELLO"
echo "HELLO"
echo "HELLO"
echo "HELLO"
echo "HELLO"
echo "HELLO"

0 comments on commit cf44cae

Please sign in to comment.