Skip to content

Set-Date did not work #5163

@chucklu

Description

@chucklu

Steps to reproduce

Set-Date -Date (Get-Date).AddDays(3)

I find this command on official document

Expected behavior

should change the datetime on my computer

Actual behavior

Set-Date : The parameter is incorrect
At line:1 char:1
+ Set-Date -Date (Get-Date).AddDays(3)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-Date], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.SetDateCommand

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-beta
PSEdition                      Core
GitCommitId                    v6.0.0-beta.6
OS                             Microsoft Windows 10.0.10586
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

I also checked the issue list, and find another issue about set-date test. I am not sure if they are the same issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions