Beginning with PowerShell 5.0, you can break into the debugger any time (in the PowerShell ISE). Simply press CTRL+B to invoke the debugger while a script runs.
The next time a script takes longer than expected, try CTRL+B and have a look what it was that took the script so long.