This should be easy but I can't get it to work. I want to read a .txt file and in this .txt file I have:
\\server1\c$
\\server2\c$
etc..
I want to create a new folder at the root of c$ for each machine.
$Data = Get-Content c:\PST\servers.txt | ForEach-Object -MKDir "$DATA\PST"
That fails. as do all the other attempts. From my PowerShell command line I can do it manually on 1 machine but not on 100 machines in a .txt file.
I've Googed this and yet to find an answer.