diff --git a/.vscode/launch.json b/.vscode/launch.json index 17f330a..fcc366c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,25 +6,20 @@ "configurations": [ { "name": ".NET Core Launch (console)", + "preLaunchTask": "build ConsoleGuiTools", "type": "coreclr", "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/Cmdlet/bin/Debug/net6.0/win10-x64/OutGridViewCmdlet.dll", - "args": [], - "cwd": "${workspaceFolder}/Cmdlet", - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Launch (application)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/Application/bin/Debug/net6.0/win10-x64/OutGridViewApplication.dll", - "args": [], - "cwd": "${workspaceFolder}/Application", - "console": "internalConsole", - "stopAtEntry": false + "program": "pwsh", + "args": [ + "-NoExit", + "-NoProfile", + "-Command", + "Import-Module ${workspaceFolder}/module/Microsoft.PowerShell.ConsoleGuiTools" + ], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal", + "stopAtEntry": false, + "justMyCode": false }, { "name": ".NET Core Attach", diff --git a/.vscode/settings.json b/.vscode/settings.json index 351aacc..d528a62 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { "files.associations": { - "**/.vsts-ci/**/*.yml":"azure-pipelines" + "**/.vsts-ci/**/*.yml":"azure-pipelines", } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0056896..e0a35c4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,33 +1,22 @@ -{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + { "version": "2.0.0", "tasks": [ { - "label": "build", - "osx": { - "command": "/usr/local/bin/pwsh" - }, - "windows": { - "command": "pwsh.exe" - }, - "linux": { - "command": "/usr/local/bin/pwsh" - }, - "type": "process", + "label": "build ConsoleGuiTools", + "command": "Invoke-Build", + "type": "shell", "args": [ - "-c", - "Invoke-Build", - // Build both modules - //"Build -ModuleName Microsoft.PowerShell.GraphicalTools, Microsoft.PowerShell.ConsoleGuiTools", - // Build only Out-GridView - //"Build -ModuleName Microsoft.PowerShell.GraphicalTools", - // Build only Out-ConsoleGridView - "Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools", + "Build", + "-Module", + "Microsoft.PowerShell.ConsoleGuiTools" ], - "problemMatcher": "$msCompile", - "group": { - "kind": "build", - "isDefault": true - } + "group": "build", + "presentation": { + "reveal": "silent" + }, + "problemMatcher": "$msCompile" } ] } \ No newline at end of file diff --git a/README.md b/README.md index d762d96..5a3fcd9 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ to view and filter objects graphically. ## Development -### 1. Install PowerShell 7.1+ +### 1. Install PowerShell 7.2+ -Install PowerShell 7.1+ with [these instructions](https://github.com/PowerShell/PowerShell#get-powershell). +Install PowerShell 7.2+ with [these instructions](https://github.com/PowerShell/PowerShell#get-powershell). ### 2. Clone the GitHub repository @@ -72,29 +72,15 @@ PS ./GraphicalTools> code . Build by hitting `Ctrl-Shift-B` in VS Code. -To debug: +Set a breakpoint and hit `F5` to start the debugger. -In a PowerShell session in the `./GraphicalTools` directory, run `pwsh` (thus -nesting PowerShell). - -Then do the folowing: +Click on the VS Code "TERMINAL" tab and type your command that starts `Out-ConsoleGridView`, e.g. ```powershell -Import-Module ./module/Microsoft.PowerShell.ConsoleGuiTools -$pid +ls | ocgv ``` -This will import the latest built DLL and output the process ID you'll need -for debugging. Copy this ID to the clipboard. - -In VScode, set your breakpoints, etc. Then hit `F5`. In the VScode search -box, paste the value printed by `$pid`. You'll see something like `pwsh.exe -18328`. Click that and the debug session will start. - -In the PowerShell session run your commands; breakpoints will be hit, etc. - -When done, run `exit` to exit the nested PowerShell and run `pwsh` again. -This unloads the DLL. Repeat. +Your breakpoint should be hit. ## Contributions Welcome diff --git a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj index 2bd6ac6..adeabd1 100644 --- a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj +++ b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj @@ -6,7 +6,7 @@ - +