While searching for solution around install.ps1 I quickly realised that the edit file -> create package -> publish -> update target cycle isnt very handly. There are step-by-step instructions on the net how to debug install.ps1, but when I tried to use them I run into new problems about incompatibility between my packages and nuget powershell cmdlets.
So I used a poor mans solution instead:
- Add some dummy content file to You package.
- Install Your package.
- Edit that dummy file (each next package install cycle will ask You about overwriting and that is what we need!)
- Open Package Manager Console (PMC) in VS
- Execute “Set-PsDebug -trace 2”. It helps You later.
- Open the install.ps1 in some editor (I used PowerShell ISE) from target project’s packages directory.
- In PMC run “update-package _yourpackagename_ -reinstall”. The installation will stop because file overwriting.
- In the PS editor edit and save install.ps1, but dont close it.
- Back to PMC and answer the overwriting question (with ‘L’ or ‘N’ to keep the modified file).
- See the results.
- Go to 7.
Not to smart, didnt uses tools and libraries but it works in acceptable cycle time.