But this is not what I want. I only get where to find different files.
What I want is to see within Dir1 and Dir2 where to find different or missing folder.
It depends pretty much on what you provide for the Compare-Object. If you’re only looking for differences in the folders I’d provide only folder paths.
Oh wow … OK, what is in the variables you want to compare? Only folders or folders and files? If there are files as well you may change this to only include folders.
I want to make the script a little more versatile and I would like to see the full path auf the directory and subdirectories. Now I get only different folder names in the result and and do not know the associated directory.
And maybe I could do it even more versatile and have an extra option to show also different files.
What exactly is the content of $Dir1 and $Dir2??? According to your initial question there are complete paths?!
You may show the sample content of the two variables you want to compare AND the expected output. Please post the raw text and format it as code.
Regardless of that: Sometimes it’s easier to explain a situation in your native language. There is a good German forum focused on Windows topics including a good scripting sub forum: https://www.mcseboard.de/forum/71-windows-forum-—-scripting/