I\'m trying to write a PowerShell module as a VB.NET project with Visual Studio 2015. I\'ve been able to put a few commands together, compile the class library into a DLL, impo
It's possible to debug your cmdlet directly without needing a separate project. Open the properties of your class library project and configure the Debug
tab as follows (assuming Windows is installed to C:
):
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
-NoLogo -Command "Import-Module '.\MyModule.dll'; Get-TestCommand;"
Edit: try this link or this step-by-step
Either downdload PowerShell Tools for Visual Studio 2015 or use Windows PowerShell ISE.
How to Debug Scripts in Windows PowerShell ISE
Updated: October 17, 2013 Applies To: Windows PowerShell 2.0, Windows PowerShell 3.0, Windows PowerShell 4.0, Windows PowerShell 5.0 This topic describes how to debug scripts on a local computer by using the Windows PowerShell® Integrated Scripting Environment (ISE) visual debugging features. How to manage breakpoints How to manage a debugging session How to step over, step into, and step out while debugging How to display the values of variables while debugging
How to manage breakpoints A breakpoint is a designated spot in a script where you would like operation to pause so that you can examine the current state of the variables and the environment in which your script is running. Once your script is paused by a breakpoint, you can run commands in the Console Pane to examine the state of your script. You can output variables or run other commands. You can even modify the value of any variables that are visible to the context of the currently running script. After you have examined what you want to see, you can resume operation of the script. You can set three types of breakpoints in the Windows PowerShell debugging environment: Line breakpoint. The script pauses when the designated line is reached during the operation of the script...