79401260

Date: 2025-01-30 21:24:33
Score: 0.5
Natty:
Report link

Unless someone has a better answer. I will just add the following to my scripts that need automatic names. Its a bummer that I can't get it to work as an imported function.

$filename = $home + [IO.Path]::DirectorySeparatorChar + (Get-Date).ToString("yyyy-MM-dd_") + [System.IO.Path]::GetFileName($MyInvocation.MyCommand.Path) -replace '\.[^.]+$','.csv'

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: dcaz