I have csv file with list of filepaths:
Filename
C:\Users\postgres\1.tmp
C:\Users\postgres222\2.txt
C:\Users\postgres3333\3.jpeg
I would like to loop through that list and to create in the same directory txt file per every file with below information: Today's date Filepath Name of file
so in example for 1st file it should be file C:\Users\postgres\1.tmp.txt
with data:
03\11\2021
C:\Users\postgres\1.tmp
1.tmp
I tried:
$Time=Get-date
$data = "\mydir"
foreach($file in Get-ChildItem $data){New-Item -ItemType file -Path $Get-Item $file.Fullpath + ".txt" -Value $Time Add-Content $Get-Item $file.Fullpath}