Creating a new level inside a commandlet

Is there a simple example available on how to create a new level from inside a commandlet ?
Is this possible ?

My main idea is to load a “master” level, change some of the objects and then save the level with another name.