tonypags
Contributor
Contributor

I have this same issue. I was trying to find the change I made before this started happening to several of my VMWare scripts running from task scheduler on windows 2012. It's most definitely a VMWare module problem, but damned as I am, cannot trace the source (the source code is in DLLs, above my paygrade). VMWare module has lots of quirks, it's slow and bloated, etc. 

I finally figured that it's not any command that's doing it, but rather the import-module activity. Much appreciation to folks on this thread for nudging me in the right direction. 

NB: I have a unique config for my environments. My profile does create a generic transcript when a session starts. But also, all of my production scripts have a transcript block at the top to restart and rename the transcript file to match the script name.

So for my case, I have an opportunity to restart the transcript AFTER the script is executed. This is key for this workaround: I added a #Requires statement to the top of my script to load the module immediately when the script is called. Then my script logic restarts the transcript for me.

#Requires -Modules VMware.VimAutomation.Core, OtherModuelsToo, Etc
Reply
0 Kudos