I'm attempting to eliminate leading any leading zeroes 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 to the output to be "1-4-2008"
any ideas on another way of doing this?
thanks in advance
$fileDate = $fileDate.ToString("M-d-yyyy")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With