that is not my issue … I have userid’s listed in CSV that i would like to use as source to delete folders named as those userID’s
Every user in the company have a folder on the server named as there userid.
For some reason my previous reply has gone missing…
I have to agree with Kardock, you need to specify the -Recurse switch to delete profile folders which have child-items (as most profile folders do). If you do not, you will be asked to delete the folder and it’s child-items which is something you might not want. If you change your script to this it should work just fine.
[quote quote=286363]For some reason my previous reply has gone missing…
I have to agree with Kardock, you need to specify the -Recurse switch to delete profile folders which have child-items (as most profile folders do). If you do not, you will be asked to delete the folder and it’s child-items which is something you might not want. If you change your script to this it should work just fine.
Please let us know if this is what you are looking for and if we can help you with anything else.
[/quote]
i tried with the -recurse but like i set even before i was not prompt for deletion.
For me there is a path issue .
As in the csv it is a userid and not a c:.… path
Based on what I see, you got a bit other issues, the path is passed to the FileSystem Driver with the double-quote C:</span>temp</span>profiles</span>“geve”:String
This is wrong and cannot be parsed, I am sure that the folder itself don’t include a “” marks
You will need to remove the “” by during parsing the folders
In version 7, the type information doesn’t appear by default (yay!) and you can omit the quotes by specifying -UseQuotes Never. If you don’t have version 7 available, because you only have one column and as you’re using Get-Content rather than Import-CSV (i.e. treating your data as String objects rather than the custom objects that Import-CSV generates) I would suggest you just export your data to a text file with Out-File or Set-Content.