Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    \$\begingroup\$ you can save this code $args|% -Pa{sleep $_;$_}-Th 99 to a stanalone .ps1 script file. This is a Powershell program. \$\endgroup\$ Commented Feb 18, 2020 at 6:02
  • \$\begingroup\$ @mazzy Nice! this question specifically asks for "a function" including the function definition, so I'm not sure if it counts - if it is valid, it's -10 and would put it around 3rd shortest, which would be good. \$\endgroup\$ Commented Feb 18, 2020 at 7:21
  • \$\begingroup\$ A file with a Powershell script is both a program and a function. So a code that works in a standalone .ps1 file fits perfectly \$\endgroup\$ Commented Feb 18, 2020 at 7:27