when i use powercli create a vm with Template and OSCustomizationSpec ,An error will appear
when i restart the powershell ise,errer is gone
That is a known issue, sometimes there is a corruption, and the only way out is to stop/start the PS/PowerCLI session.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference