I am inconsistently getting this warning and I’m not sure what to do to get rid of it.
Apr 21, 2022 2:10 PM [warning] [13:10:05][Start-PSFRunspace] Failed to start runspace: PSFramework.Logging | Exception calling “Start” with “0” argument(s): “Object reference not set to an instance of an object.”
I also see this as well.
Apr 21, 2022 2:15 PM [warning] [13:15:05][Start-PSFRunspace] Failed to start runspace: PSFramework.Logging | Exception calling “Start” with “0” argument(s): "Cannot perform operation because object “PowerShell” has already been disposed.
It does not happen all the time, probably 50-60%. The script presents this very quickly, then processed to run as normal, but as a result the script gets flagged with a warning.
I did some google searches and found what module it is part of, but not much else. I assume this module is part of Powershell Universal, but also understand it may not be.
I’m running PWSH 7.2 on the server where this is running, and this is running in a non-persistent, non-high performance runspace pool.
Thanks in advance for any assistance that can be provided.
I’ve seen the same thing, though much less frequently (around once every couple of days). And mine doesn’t seem tied to an actual schedule/job, but because I defined the PSFramework logging provider to this folder, I’m assuming it may be an internal PSU logging function or something. I’m currently running v2.8.1 of PSU:
Good to know. I’m not sure Start-PSFRunspace is a public cmdlet within the module since the only commands I use from it are the Set-PSFLoggingProvider and Write-PSFMessage. But will keep that in mind and see if can track it down when I have time. It doesn’t appear to be hurting anything for us at the moment.
I found the module PSFramework was installed in the Universal folder, so I trashed it to see what it would do. Its throwing full errors now, but it has identified where it actually came from.
Apr 21, 2022 4:41 PM [error] The required module 'PSFramework' is not loaded. Load the module or remove the module from 'RequiredModules' in the file 'C:\ProgramData\UniversalAutomation\Repository\Modules\SecretManagement.Keepass\0.9.2\SecretManagement.Keepass.psd1'.
Seems as though the KeePass module is using it for some reason.