Install ReportUnit from Nuget.
Example on how you can verify that code in a Powershell script is valid Powershell code using Pester