I have noticed that questions that are partly unrelated to other questions are being closed even though it's related but the functionality is not the same?

As an example, this is one I have just noticed:

How to correctly dispose spweb and spsite on powershell foreach!

I'm not here to question the admin motive but I just think this question is a legit question that is partly related to the one he said is answered for. But the one he posted is not related to PowerShell as its more c# asking about iterating objects and disposing of them. The op asked about powershell which is slightly different (code wise).

The principle is the same but the coding is not!

Surely we can differentiate between the two, one being in c# and the other in powershell?

I hope someone could shed some light :) (is it overkill?)

1 Answer 1


In this case, it is related to Disposal patterns, which are exactly the same if you use c# or PowerShell. The syntax is the only difference, and is not the primary objective in the question.

The question is how you should dispose in a foreach-loop of SPSite / SPWeb objects in both of the questions. The answer is the same in both languages.

If the question was related to the actual syntax of PowerShell - like how to do a foreach in the best way - it would be a different story.

  • thanks for explaining :) i guess its how you write the question!
    – Ali Jafer
    Dec 18, 2013 at 13:05
  • At least that was why I marked it as a duplicate :) Sometimes these lines are thinner than other times Dec 18, 2013 at 13:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .