Skip to content

Start-Sleep -Duration is an error #11447

@roaima

Description

@roaima

Type of issue

Code doesn't work

Feedback

Powershell ($PSVersion) 5.1.22621.4111 on Windows 11 Pro 23H2. The -Duration parameter is not recognised.

Consider Example 3 in the documentation:

Start-Sleep -Duration (New-TimeSpan -Seconds 30)
Start-Sleep : A parameter cannot be found that matches parameter name 'Duration'.
At line:1 char:13
+ Start-Sleep -Duration (New-TimeSpan -Seconds 30)
+             ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Start-Sleep], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.StartSleepCommand

Page URL

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/start-sleep?view=powershell-7.4

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Utility/Start-Sleep.md

Author

@sdwheeler

Document Id

b7e7a855-2cef-6e01-a6c4-919ce8cb575d

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolution-answeredStatus - closed by existing documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions