Powershell: how to format get-date for string and remove 0?
I am trying to remove leading zeros in my date when I run the get-date cmdlet by trying:
$filedate = get-date -uformat "%m-%d-%Y"
$filedate = $filedate.ToString().Replace("0", "")
this returns "01-04-2008"
I want the output to be "1-4-2008"
any ideas for another way to do this?
early
+11
source to share