PowerShell Script create files


The script is to generate files with names consisting of the domain name and the name of the operating system installed on the computer example: domain_name-Windows10.CSV. Each file should contain the following information: computer name. Can someone guide me how to do the first part with creating files? Thanks

Welcome to the forum. :wave:t4:

If this is an internship assignment or homework assignment we try to avoid assisting with those as the first port of call should be your tutor or supervisor.

In general … This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

We actually expect you to make an own attempt at the first place to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

Regardless of all that … what you’re asking for is a very common and simple requirement needing only basic knowledge. There are probalby thousands of examples already available in the internet. Please use your preferred internet search engine and search for examples you can adapt to your particular needs.

If you’re a beginner you may start with learning the fundamentals of PowerShell first: