Yes, you are correct! You would need to use init.ps1 or install.ps1 if you're using NuGet as a Provider. Unfortunately install.sp1 is no longer supported in Visual Studio 2017.
If the package in question, is not available in NuGet then you might want to use a different provider.
You can take a look at the PackageManagement cmdlets
You would have to manage the providers and sources depending upon the available packages.
Create your own Local Package Feed
If you want to create your own local repository: Creating Local NuGet Repository
To call a Powershell script after Install-Package command, create a file called as install.ps1 and add the below code:
Install-Package -Name 7Zip4Powershell
<Your stuff, for e.g;>
Get-ChildItem
Get-Hotfix
To run the script: powershell.exe -ExecutionPolicy Bypass -File install.ps1
If you have a code apart from Install-Package in a different ps1 file, then you can call the script:
Install-Package -Name 7zip4powershell
.\MyCode.ps1
Check out this link: Running PowerShell scripts during NuGet package installation and removal
Package Management in Windows Powershell
Lastly, if you really want to see whats the code inside Install-Package
, check out: Disassemble Powershell cmdlet
Hope this helps!