Skip to main content

Using the Pipeline

For many tasks you can "pipe" output from a cmdlet (like New-MSGraphMail) into further commandlets to take action on the object you just created or fetched.

You can pipe emails into Send-MSGraphMail to send them, into Move-MSGraphMail to move them to another folder, or into Remove-MSGraphMail to delete them.

When using the pipeline you should pass the parameter -Pipeline to the commandlet which generates the objects you want to pipe. This will make sure that the objects are in a suitable format for the next commandlet to process them.