Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How do I get a log file...

$
0
0

Hi Guys,

I have a script which removes a folder from a number of servers, names of which are in a .ini file.

$VM_names = Get-Content "D:\Scripts\VMnames.ini"
ForEach ($VM in $VM_names){ Remove-Item "\\$VM\modules\foldername"  -Recurse -Force }

I'd like to create a log file which contains the name of the server and the date and time when it was done.

Any help would be much appreciated.

Cheers

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles