In File Explorer, shift + rightclick on the folder and select Open PowerShell window here

When Powershell opens, add dir > test2.txt and hit <ENTER> (in this example "test2" will be the file name of the txt file.

 

If entered correctly (beware of spaces in above example), there will be no error message:

 

The txt file now is saved automatically within this folder:

 

Txt file has details as shown below: