how to output debugging messages from install.ps1 in NuGet
nuget, powershell
Solution
I could not get the output when installing from the NuGet Package Manager Dialog, I'll dig a bit later to see where it's going.
But you should be able to see it when installing from the Nuget console (Tools->Library Package Manager->Package Manager Console). The output went directly in the console. Example :
PM> uninstall-package samplepackage
hello from unninstal.ps1
Successfully removed 'samplepackage 1.0.0' from WebApplication24.
unninstal.ps1 :
param($installPath, $toolsPath, $package, $project)
Write-Host "hello from unninstal.ps1"
Problem
I am developing a NuGet package, including an `install.ps1` script which runs during the package installation. I would like to be able to output messages from my script and also output the results of running `.bat` files from within my sript. Here is my `install.ps1`: ``` param($installPath, $toolsPath, $package, $project) Write-Output "Running install.ps1 for MyPkg" Set-Location $toolsPath .\helper.bat | Write-Output ``` When I install my package in Visual Studio, then I look in the `Package Manager` option in the `Output` page, I see: ``` Executing script file 'C:\Test\packages\MyPkg.1\tools\install.ps1'. ``` and it seems the script is working (I can tell in other ways that `helper.bat` ran), but I don't see any of the output. How can I get the output working?