So we can include an install/uninstall powershell scripts in a NuGet package. I tried, but my install.ps1 does not work. Is there any possibility to find out why? Debugging,
Perhaps I am late to the party but here is a solution for debugging NuGet specific scripts, the NuGet package NuGetDebugTools. Its script Add-Debugger.ps1 adds a simple and yet effective debugger to the NuGet package manager console.
The sample scenario:
open NuGet console and type commands
PM> Add-Debugger [-ReadHost]
PM> Set-PSBreakpoint -Command init
PM> Set-PSBreakpoint -Command install
(or set more specific breakpoints, see help Set-PSBreakpoint)
type ? as debugger input and see what you can do:
s, StepInto Step to the next statement into functions, scripts, etc.
v, StepOver Step to the next statement over functions, scripts, etc.
o, StepOut Step out of the current function, script, etc.
c, Continue Continue operation (also on empty input).
q, Quit Stop operation and exit the debugger.
?, h Display this help message.
r Display PowerShell command history.
k Display call stack (Get-PSCallStack).
Show debug location in context of lines.
+ Set location context preference to lines.
Invoke any PowerShell and write its output.
type other debugger and PowerShell commands and watch the output in the NuGet console
v1.4.0 - New switch ReadHost tells to use Read-Host for input instead of the default GUI input box.