From 7ef4b3d9a6c821de48c88d06a87fdd707eae6da7 Mon Sep 17 00:00:00 2001 From: freedbygrace Date: Thu, 28 May 2020 13:41:31 -0400 Subject: [PATCH] Add files via upload --- Set-OSDTime.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Set-OSDTime.ps1 b/Set-OSDTime.ps1 index 5d6a875..a68c9a8 100644 --- a/Set-OSDTime.ps1 +++ b/Set-OSDTime.ps1 @@ -107,6 +107,7 @@ [Parameter(Mandatory=$False)] [ValidateNotNullOrEmpty()] + [Alias('NTPServer')] [String]$NTPServerFQDN = "pool.ntp.org", [Parameter(Mandatory=$False)] @@ -298,6 +299,9 @@ ForEach ($ModuleGroup In $ModuleGroups) If ($IsWindowsPE -eq $True) { + $WarningMessage = "[WindowsPE Detected] - Additional file(s), system settings, and registry changes are required to allow time synchronization to occur." + Write-Warning -Message "$($WarningMessage)" -Verbose + [System.IO.DirectoryInfo]$Path_w32tm = "$($ToolsDirectory.FullName)\w32tm" $GetFiles_w32tm = Get-ChildItem -Path "$($Path_w32tm.FullName)" -Recurse -Force | Where-Object {($_ -is [System.IO.FileInfo])} @@ -330,6 +334,11 @@ ForEach ($ModuleGroup In $ModuleGroups) If ($CurrentTimeZone.ID -ine $DestinationTimeZoneID) {$SetTimeZone = Set-TimeZone -Id "$($DestinationTimeZone.ID)" -PassThru} } + Else + { + $LogMessage = "[WindowsPE Not Detected] - No additional changes are required to allow time synchronization to occur." + Write-Verbose -Message "$($LogMessage)" -Verbose + } $LogMessage = "Time Before NTP Synchronization: $((Get-Date).ToString($DateTimeLogFormat)) - [$($DestinationTimeZone.DisplayName)]" Write-Verbose -Message "$($LogMessage)" -Verbose