I’m new to PowerShell scripting. I created a test script to convert a *.csv file from another folder and I want to save in a folder with the date. EX: c:\TEST_Convert\09072019\Convertfile_09072019.xls. Can you tell me how to add the date in the path?
$newfolder=New-Item -Type Directory $(Get-Date -UFormat ‘%m%d%Y’)
$CurrentDate = Get-Date -UFormat ‘%m%d%Y’
$xl = new-object -comobject excel.application
$xl.visible = $true
$Workbook = $xl.workbooks.open(“C:\TEST_Copy\09072019\TestFile.csv”)
$Worksheets = $Workbooks.worksheets
$Workbook.Saved = $True