Hi,
I'm having a problem with running Test-VMHostProfilecompliance if it's being run as a job in powershell.
This command works fine:
connect-viserver vctr-01 -Credential $vc_cred;Get-VMHost esxserver01 | Test-VMHostProfileCompliance
However, when I run this command:
start-job -ScriptBlock {param($vc_cred) connect-viserver vctr-01 -Credential $vc_cred;Get-VMHost esxserver01 | Test-VMHostProfileCompliance} -ArgumentList $vc_cred
The command completes but then powershell crashes.
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: powershell.exe
Problem Signature 02: 6.3.9600.16384
Problem Signature 03: 5215ef23
Problem Signature 04: VimService55.XmlSerializers
Problem Signature 05: 5.5.0.0
Problem Signature 06: 52f4dcd7
Problem Signature 07: 157e
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.3.9600.2.0.0.256.48
Locale ID: 1033
Additional Information 1: 5938
Additional Information 2: 5938d74001449eb7db5fd03013cd462e
Additional Information 3: 5ad8
Additional Information 4: 5ad8d060406a589e1a1435a34a781f82
This happens whether the background job is a .ps1 file or scriptblock.
I'm running PowerCLI 5.8 on a Windows 8 computer, also replicated on PowerCLI 5.5 on Windows 2012.
Any ideas?
Thanks,
-Ben