Powershell script to script out database, tables, sp, udfs

Powershell script to script out database, tables, sp, udfs using
SMO.Scripter