Change default format time dd/MM/yyy in script via Get-Culture?


I have an html report in which I include dates.
Now these dates appear in month/day/year. I want to prevent to need to change every date to format dd/mm/yyyy.
Practical example in SCCM:(Get-CMDeployment -CollectionName $CollectionX).deploymenttime gives 11/15/2017 09:15:33
whereas it should be 15/11/...

Is there a way to set it in beginning of script so dates are in correct format?
Set-Culture -CultureInfo de-de but that does not work.

Please advise.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pankaj KumarSystems SpecialistCommented:
Hi Try this, where "d" is date format specifier

Get-CMDeployment -CollectionName $CollectionX | Select @{'N'= "deploymenttime"; 'E'= {$_.Deploymenttime.GetDateTimeFormats("d")[0]}}

there are other format specifier are available as well , refer on web
janhoedtAuthor Commented:
Well, that's exactly what I do not want to do. I do not want to change in each and every command the date.
I would like to set it by default in date/month/year regardless what script(s), functions or  modules  I use.
Pankaj KumarSystems SpecialistCommented:
Then Try below code in to set date time format. it will set datetime format for your profile and you will get required datetime format in your script output.

Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sShortDate -Value dd/MM/yyyy

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.