From 3757fd273f408f67376b656ff52d88a744246fef Mon Sep 17 00:00:00 2001 From: 924312 <924312@gmail.com> Date: Fri, 15 May 2026 14:22:13 +1200 Subject: [PATCH] Update SCCMActions.ps1 Get-CurrentDate function old code would only work for americans and was using a very roundabout way to achieve it's goal --- SCCMActions.ps1 | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/SCCMActions.ps1 b/SCCMActions.ps1 index a360754..af6264b 100644 --- a/SCCMActions.ps1 +++ b/SCCMActions.ps1 @@ -34,15 +34,8 @@ function Get-CurrentDate { [CmdletBinding()][OutputType([string])] param () - $CurrentDate = Get-Date - $CurrentDate = $CurrentDate.ToShortDateString() - $CurrentDate = $CurrentDate -replace "/", "-" - If ($CurrentDate[2] -ne "-") { - $CurrentDate = $CurrentDate.Insert(0, "0") - } - If ($CurrentDate[5] -ne "-") { - $CurrentDate = $CurrentDate.Insert(3, "0") - } + $CurrentDate = Get-Date -Format "MM-dd-yyyy" + Return $CurrentDate }