Repository navigation
Set-Date did not work #5163
Copy link
Copy link
Closed
Labels
OS-WindowsResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
Milestone
Description
Activity
This works on Ubuntu, but fails on Windows 10 for me
I reproduced this problem on Windows 10.
Microsoft.PowerShell.Commands.SetDateCommand.SystemTimeshould bestruct.PowerShell/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs
Lines 117 to 134 in 2f81861
internal static class NativeMethods { [StructLayout(LayoutKind.Sequential)] public class SystemTime { public UInt16 Year; public UInt16 Month; public UInt16 DayOfWeek; public UInt16 Day; public UInt16 Hour; public UInt16 Minute; public UInt16 Second; public UInt16 Milliseconds; } [DllImport(PinvokeDllNames.SetLocalTimeDllName, SetLastError = true)] public static extern bool SetLocalTime(ref SystemTime systime); } // NativeMethods Reacted by Steve LeeMaximoTrinidad commented
on Jan 24, 2018 More actionsMaximo Trinidad (@MaximoTrinidad) I have checked the release list, the latest version is released five days ago with sha-1 2f81861.
I will wait for next release version, thanks.- addedWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesand removed
on Jul 17, 2026
Metadata
Metadata
Assignees
Labels
OS-WindowsResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues


Steps to reproduce
I find this command on official document
Expected behavior
Actual behavior
Environment data
I also checked the issue list, and find another issue about set-date test. I am not sure if they are the same issue.