Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 751739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:42:05+00:00 2026-05-14T14:42:05+00:00

I may be trying an invalid approach, so I’m open to any suggestions. I’m

  • 0

I may be trying an invalid approach, so I’m open to any suggestions.

I’m running a series of 3 scripts that each do an analysis of websites on an IIS server, and I’m running them against a couple hundred servers. I’m proof-of-concepting doing this as a Start-Job process so I can run in parallel and finish a lot more quickly. These scripts mostly wait around for WMI and the file system to gather and return data, so parallel waiting makes a lot of sense.

But I can’t get my jobs to log. I’m piping a data row to the script and trying to send the Log4net $Logger as a parameter, but the new Powershell processes can’t do anything with it. Here’s what I’ve tried:
(In the calling script)
$jobs += Start-Job -InputObject $app -FilePath $command -Name $app.Name -ArgumentList $Log

(In the called script)

param ([parameter(Mandatory=$false,ValueFromPipeline=$true)]  
$object, 
[parameter(Position=0)] 
$Logger) 

(Result)

Unable to find type [log4net.ThreadContext]: make sure that the assembly containing this type is loaded.

I’ve tried various flavors of loading the log4net.dll in the called script. That results in:

Method invocation failed because [Deserialized.log4net.Core.LogImpl] doesn't contain a method named 'Info'

I’ve also tried just instantiating a new $Logger in the called script processes, and that does result in some log action, but not accurately. Of 20 processes, I only get some messages from 9 of them and all messages from none.

Not logging is not an option. The work is complex. Running different logs for each instance of the script might be doable, though it’d be a nasty, nasty nuisance. Mostly, I just figure I’m doing something uninformed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:42:05+00:00Added an answer on May 14, 2026 at 2:42 pm

    Each spawned PowerShell process is its own memory space. Nothing is shared between them, so asking log4net to safely manipulate a file system log in multiple spawned jobs is a fail. Database or event log logging handles the safety issues appropriately and resolved this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to find records in a VARCHAR column that may contain a NUL
I'm trying to parse a log file that looks like this: %%%% 09-May-2009 04:10:29
I am trying to write a program that will stop whenever an invalid operation
I am currently trying to hook up jQuery UI dialog so that I may
I'm trying to create a relation where any of four different parts may be
Im trying to accomplish something which may seem a bit convoluted but would be
May be I can't explain exactly in words what I am trying to achieve,
this may be stupidly simple but I'm trying to figure out a way to
I am trying to use (and this may be my problem already) e.Graphics.CopyFromScreen() in
I am trying to find out whether local press releases may have affected companies'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.