You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
Running $test.ps1 as part of a scheduled task via an administrative user intermittently shows the below error. It's seems to be root caused to dot sourcing inside a foreach-object -parallel as a job, as I cannot reproduce via dot sourcing a script without using foreach-object -parallel.
The partial WORKAROUND is don't dot source inside a foreach-object -parallel -asjob, but then you cannot as easily utilize runspace background jobs.
Computer has latest drivers, BIOS, firmware, and updates applied, with AV turned off.
System.Management.Automation.ParameterBindingException: A parameter cannot be found that matches parameter name 'Provider'. at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at Get-InstalledModule<Process>(Closure , FunctionContext ) at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.PSScriptCmdlet.DoProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord()
Environment data
get-errorA parameter cannot be found that matches parameter name 'Provider'.
$psversiontable
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Get-Module -ListAvailable PowerShellGet,PackageManagement
Directory:
C:\Users\system2\Documents\PowerShell\Modules
ModuleType Version PreRelease Name
---------- ------- ---------- ----
Script 2.2.5 PowerShellGet
Directory: C:\program
files\powershell\7\Modules
ModuleType Version PreRelease Name
---------- ------- ---------- ----
Script 1.4.7 PackageManag…
Script 2.2.5 PowerShellGet
Directory: C:\Program
Files\WindowsPowerShell\Modules
ModuleType Version PreRelease Name
---------- ------- ---------- ----
Binary 1.0.0.1 PackageManag…
Script 1.0.0.1 PowerShellGet
PS C:\Windows\System32>
Steps to reproduce
Running $test.ps1 as part of a scheduled task via an administrative user intermittently shows the below error. It's seems to be root caused to dot sourcing inside a foreach-object -parallel as a job, as I cannot reproduce via dot sourcing a script without using foreach-object -parallel.
The partial WORKAROUND is don't dot source inside a foreach-object -parallel -asjob, but then you cannot as easily utilize runspace background jobs.
Computer has latest drivers, BIOS, firmware, and updates applied, with AV turned off.
$test.ps1
check.ps1
test.xml
Expected behavior
Actual behavior
Environment data
The text was updated successfully, but these errors were encountered: