November 2018
Intermediate to advanced
566 pages
17h 15m
English
Add the following block to the end of your module file and save the file:
$MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
Write-Output "Module cleaned up."
}
Register-EngineEvent PowerShell.Exiting {
Remove-Module '12-New-File'
}
Remove the module from the session to see what this does.
Read now
Unlock full access