From 919b26625a17fc7a5a2cf5e9b62abd5c076e85ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Mon, 13 Apr 2020 14:04:13 +0200 Subject: [PATCH 01/11] Create RFCNNNN-TimeSpan-Literals.md --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md new file mode 100644 index 000000000..1d76c7335 --- /dev/null +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -0,0 +1,70 @@ +--- +RFC: RFC +Author: Anselm Schüler +Status: Draft +Area: Syntax and Cmdlet implementation +Comments Due: +Plan to implement: +--- + +# `TimeSpan` Literals and support for `TimeSpan` objects in Cmdlets such as Start-Sleep + +A new syntax expansion that adds support for `TimeSpan` literals, and cmdlets such as `Start-Sleep` accepting `TimeSpan` objects by default. +This entails adding new suffixes to numeric literals as [described here](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/About/about_numeric_literals?view=powershell-7) +This is helful as current methods for time specification have significant drawbacks (see Motivation) +This solution is significantly more concise than using `New-TimeSpan` (see User Experience). +The semantics of this method are more clear, as cmdlets with the `New` verb are usually used in variable assignments, i.e. for persistent objects. + +## Motivation + +Cmdlets such as `Start-Sleep` offer both `-Seconds` and `-Milliseconds` as parameters. +This style of time input is functional, but has a few issues: +- Expanding the number of units requires updating the argument handling and the function body itself +- Implementation in custom scripts or cmdlets requires boilerplate +- Available options may not be consistent across cmdlets + +## User Experience + +Example of expressions and their equivalents in current PowerShell: + +| `10sec` | `New-TimeSpan -Seconds 10` | `[TimeSpan]100000000` | +| `15min` | `New-TimeSpan -Minutes 15` | `[TimeSpan]9000000000` | +| `0xFFyear` | `New-TimeSpan -Days (0xFF * 365)` | `[TimeSpan]80416800000000000` | + +Example of user interaction: + +``` +Start-Sleep 20sec +``` +Result: Sleep for 20 seconds + +``` +Start-Sleep 5min +``` +Result: Sleep for 300 seconds + +``` +Start-Sleep 100ms +``` +Result: Sleep for 0.1 seconds + +## Specification + +The following suffixes would now be recognized as `TimeSpan` objects: +- `min` minutes +- `sec` seconds +- `ms` milliseconds +- `h` hours +- `dy` days + +These suffixes are not combinable with multiplier suffixes or type suffixes. + +The `Start-Sleep` cmdlet is expanded to allow a `-TimeSpan` parameter, where a `TimeSpan` object can be passed. + +The behaviour of `Start-Sleep` when only one anonymous parameter is given is changed such that a non-`TimeSpan` object is interpreted as seconds and a `TimeSpan` object is interpreted as argument to parameter `-TimeSpan` + +## Alternate Proposals and Considerations + +These suffixes ideally do not interfere with the existing suffixes, as the types of the numbers would already be determined by the time unit. For example, `tick` will always be `Int64` (or in case of future changes the type used for `TimeSpan`'s `Ticks` property) + +A year unit could be added, however, this requires deciding on the length of a year, which may be contentious. From a9daa54e4119e56976a4d4531c473981b197649f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Mon, 13 Apr 2020 14:16:35 +0200 Subject: [PATCH 02/11] Update RFCNNNN-TimeSpan-Literals.md --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 68 +++++++++++++++++-- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index 1d76c7335..56b463948 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -9,10 +9,9 @@ Plan to implement: # `TimeSpan` Literals and support for `TimeSpan` objects in Cmdlets such as Start-Sleep -A new syntax expansion that adds support for `TimeSpan` literals, and cmdlets such as `Start-Sleep` accepting `TimeSpan` objects by default. -This entails adding new suffixes to numeric literals as [described here](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/About/about_numeric_literals?view=powershell-7) -This is helful as current methods for time specification have significant drawbacks (see Motivation) -This solution is significantly more concise than using `New-TimeSpan` (see User Experience). +A new syntax expansion that adds support for `TimeSpan` literals, and cmdlets such as `Start-Sleep` accepting `TimeSpan` objects by default - this entails adding new suffixes to numeric literals as [described here](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/About/about_numeric_literals?view=powershell-7). +This is helful as current methods for time specification have significant drawbacks (see Motivation). +This solution is significantly more concise than using `New-TimeSpan` (see User Experience). The semantics of this method are more clear, as cmdlets with the `New` verb are usually used in variable assignments, i.e. for persistent objects. ## Motivation @@ -27,6 +26,8 @@ This style of time input is functional, but has a few issues: Example of expressions and their equivalents in current PowerShell: +| New syntax | With `New-TimeSpan` | With type conversion | +| --- | --- | --- | | `10sec` | `New-TimeSpan -Seconds 10` | `[TimeSpan]100000000` | | `15min` | `New-TimeSpan -Minutes 15` | `[TimeSpan]9000000000` | | `0xFFyear` | `New-TimeSpan -Days (0xFF * 365)` | `[TimeSpan]80416800000000000` | @@ -38,16 +39,65 @@ Start-Sleep 20sec ``` Result: Sleep for 20 seconds +--- + ``` Start-Sleep 5min ``` Result: Sleep for 300 seconds +--- + ``` Start-Sleep 100ms ``` Result: Sleep for 0.1 seconds +--- + +``` +$TimeSpan = 15sec +$TimeSpan +``` +``` + +Days : 0 +Hours : 0 +Minutes : 0 +Seconds : 15 +Milliseconds : 0 +Ticks : 150000000 +TotalDays : 0.000173611111111111 +TotalHours : 0.00416666666666667 +TotalMinutes : 0.25 +TotalSeconds : 15 +TotalMilliseconds : 15000 + + +``` + +--- + +``` +20dy +``` +``` + +Days : 20 +Hours : 0 +Minutes : 0 +Seconds : 0 +Milliseconds : 0 +Ticks : 17280000000000 +TotalDays : 20 +TotalHours : 480 +TotalMinutes : 28800 +TotalSeconds : 1728000 +TotalMilliseconds : 1728000000 + + +``` + ## Specification The following suffixes would now be recognized as `TimeSpan` objects: @@ -61,10 +111,18 @@ These suffixes are not combinable with multiplier suffixes or type suffixes. The `Start-Sleep` cmdlet is expanded to allow a `-TimeSpan` parameter, where a `TimeSpan` object can be passed. -The behaviour of `Start-Sleep` when only one anonymous parameter is given is changed such that a non-`TimeSpan` object is interpreted as seconds and a `TimeSpan` object is interpreted as argument to parameter `-TimeSpan` +The behaviour of `Start-Sleep` when only one anonymous parameter is given is changed such that a non-`TimeSpan` object is interpreted as seconds and a `TimeSpan` object is interpreted as argument to parameter `-TimeSpan`. ## Alternate Proposals and Considerations These suffixes ideally do not interfere with the existing suffixes, as the types of the numbers would already be determined by the time unit. For example, `tick` will always be `Int64` (or in case of future changes the type used for `TimeSpan`'s `Ticks` property) A year unit could be added, however, this requires deciding on the length of a year, which may be contentious. + +## Related + +Related proposal on the PowerShell issues page: +https://github.com/PowerShell/PowerShell/issues/10712 + +Original proposal thread on the PowerShell issues page: +https://github.com/PowerShell/PowerShell/issues/12305 From e9f35169ac41dd661bd3141d9cddcd7b1f3676e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Sat, 8 May 2021 19:20:28 +0200 Subject: [PATCH 03/11] Updated syntax --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index 56b463948..dc53976ab 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -18,6 +18,7 @@ The semantics of this method are more clear, as cmdlets with the `New` verb are Cmdlets such as `Start-Sleep` offer both `-Seconds` and `-Milliseconds` as parameters. This style of time input is functional, but has a few issues: + - Expanding the number of units requires updating the argument handling and the function body itself - Implementation in custom scripts or cmdlets requires boilerplate - Available options may not be consistent across cmdlets @@ -34,32 +35,36 @@ Example of expressions and their equivalents in current PowerShell: Example of user interaction: -``` +```pwsh Start-Sleep 20sec ``` + Result: Sleep for 20 seconds --- -``` +```pwsh Start-Sleep 5min ``` + Result: Sleep for 300 seconds --- -``` +```pwsh Start-Sleep 100ms ``` + Result: Sleep for 0.1 seconds --- -``` +```pwsh $TimeSpan = 15sec $TimeSpan ``` -``` + +```none Days : 0 Hours : 0 @@ -78,10 +83,11 @@ TotalMilliseconds : 15000 --- -``` +```pwsh 20dy ``` -``` + +```none Days : 20 Hours : 0 @@ -101,6 +107,7 @@ TotalMilliseconds : 1728000000 ## Specification The following suffixes would now be recognized as `TimeSpan` objects: + - `min` minutes - `sec` seconds - `ms` milliseconds @@ -121,8 +128,6 @@ A year unit could be added, however, this requires deciding on the length of a y ## Related -Related proposal on the PowerShell issues page: -https://github.com/PowerShell/PowerShell/issues/10712 +[Related proposal on the PowerShell issues page](https://github.com/PowerShell/PowerShell/issues/10712) -Original proposal thread on the PowerShell issues page: -https://github.com/PowerShell/PowerShell/issues/12305 +[Original proposal thread on the PowerShell issues page](https://github.com/PowerShell/PowerShell/issues/12305) From 6a29dfb1c0792517d42e6b70ed86a770a4fec89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Sun, 9 May 2021 03:15:15 +0200 Subject: [PATCH 04/11] Updated RFC content to reflect new developements --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index dc53976ab..887785ccb 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -4,25 +4,31 @@ Author: Anselm Schüler Status: Draft Area: Syntax and Cmdlet implementation Comments Due: -Plan to implement: +Plan to implement: Yes --- # `TimeSpan` Literals and support for `TimeSpan` objects in Cmdlets such as Start-Sleep A new syntax expansion that adds support for `TimeSpan` literals, and cmdlets such as `Start-Sleep` accepting `TimeSpan` objects by default - this entails adding new suffixes to numeric literals as [described here](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/About/about_numeric_literals?view=powershell-7). -This is helful as current methods for time specification have significant drawbacks (see Motivation). -This solution is significantly more concise than using `New-TimeSpan` (see User Experience). -The semantics of this method are more clear, as cmdlets with the `New` verb are usually used in variable assignments, i.e. for persistent objects. +This is helpful as current methods for time specification have significant drawbacks (see Motivation). +This solution is significantly more concise than using `New-TimeSpan` (see User Experience). ## Motivation +### Practicality + Cmdlets such as `Start-Sleep` offer both `-Seconds` and `-Milliseconds` as parameters. This style of time input is functional, but has a few issues: - Expanding the number of units requires updating the argument handling and the function body itself -- Implementation in custom scripts or cmdlets requires boilerplate +- Implementation in custom scripts or cmdlets may require boilerplate - Available options may not be consistent across cmdlets +### Semantics + +Commands such as `New-TimeSpan`, which is the premier way to create timespan objects, are usually used in a manner where the returned object is a persistent object that later gets mutated or is itself effectful. +By using a suffix, the intent is made clearer by the more functional style. + ## User Experience Example of expressions and their equivalents in current PowerShell: @@ -33,7 +39,7 @@ Example of expressions and their equivalents in current PowerShell: | `15min` | `New-TimeSpan -Minutes 15` | `[TimeSpan]9000000000` | | `0xFFyear` | `New-TimeSpan -Days (0xFF * 365)` | `[TimeSpan]80416800000000000` | -Example of user interaction: +### Examples of user interaction ```pwsh Start-Sleep 20sec @@ -44,7 +50,7 @@ Result: Sleep for 20 seconds --- ```pwsh -Start-Sleep 5min +Start-Sleep 5m ``` Result: Sleep for 300 seconds @@ -84,7 +90,7 @@ TotalMilliseconds : 15000 --- ```pwsh -20dy +20day ``` ```none @@ -106,13 +112,16 @@ TotalMilliseconds : 1728000000 ## Specification -The following suffixes would now be recognized as `TimeSpan` objects: +The following suffixes would now be recognized and be turned into `TimeSpan` objects: -- `min` minutes -- `sec` seconds -- `ms` milliseconds -- `h` hours -- `dy` days +| Suffix | Name | Method Name | Seconds | +|-----------|---------------|-----------------------|----------| +| `day` | Days | `FromDays` | 86400 | +| `h` | Hours | `FromHours` | 3600 | +| `ms` | Milliseconds | `FromMilliseconds` | 0.001 | +| `min` | Minutes | `FromMinutes` | 60 | +| `sec` | Seconds | `FromSeconds` | 1 | +| `tick` | Ticks | `FromTicks` | | These suffixes are not combinable with multiplier suffixes or type suffixes. @@ -120,11 +129,7 @@ The `Start-Sleep` cmdlet is expanded to allow a `-TimeSpan` parameter, where a ` The behaviour of `Start-Sleep` when only one anonymous parameter is given is changed such that a non-`TimeSpan` object is interpreted as seconds and a `TimeSpan` object is interpreted as argument to parameter `-TimeSpan`. -## Alternate Proposals and Considerations - -These suffixes ideally do not interfere with the existing suffixes, as the types of the numbers would already be determined by the time unit. For example, `tick` will always be `Int64` (or in case of future changes the type used for `TimeSpan`'s `Ticks` property) - -A year unit could be added, however, this requires deciding on the length of a year, which may be contentious. +> Sidenote: I’m unsure if this is feasible. Would this require an auxiliary parameter? ## Related From 85f69adf60571c326acedccd07b3df718985f79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Sun, 9 May 2021 13:54:21 +0200 Subject: [PATCH 05/11] Removed caveat & changed wording --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index 887785ccb..fc8d6f80d 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -127,9 +127,7 @@ These suffixes are not combinable with multiplier suffixes or type suffixes. The `Start-Sleep` cmdlet is expanded to allow a `-TimeSpan` parameter, where a `TimeSpan` object can be passed. -The behaviour of `Start-Sleep` when only one anonymous parameter is given is changed such that a non-`TimeSpan` object is interpreted as seconds and a `TimeSpan` object is interpreted as argument to parameter `-TimeSpan`. - -> Sidenote: I’m unsure if this is feasible. Would this require an auxiliary parameter? +The behaviour of `Start-Sleep` when only one anonymous parameter is given is that a non-`TimeSpan` object is interpreted as an argument to parameter `-Seconds` and a `TimeSpan` object is interpreted as argument to parameter `-TimeSpan`. ## Related From bac28d6b3cde647e481d7052c369237fa83f8318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Sun, 9 May 2021 13:57:35 +0200 Subject: [PATCH 06/11] reorder & resyntax table --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index fc8d6f80d..be2599a16 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -114,14 +114,14 @@ TotalMilliseconds : 1728000000 The following suffixes would now be recognized and be turned into `TimeSpan` objects: -| Suffix | Name | Method Name | Seconds | -|-----------|---------------|-----------------------|----------| -| `day` | Days | `FromDays` | 86400 | -| `h` | Hours | `FromHours` | 3600 | -| `ms` | Milliseconds | `FromMilliseconds` | 0.001 | -| `min` | Minutes | `FromMinutes` | 60 | -| `sec` | Seconds | `FromSeconds` | 1 | -| `tick` | Ticks | `FromTicks` | | +| Suffix | Name | Method Name | Seconds | +|-----------|---------------|-----------------------|-----------| +| `day` | Days | `FromDays` | 86400 | +| `h` | Hours | `FromHours` | 3600 | +| `min` | Minutes | `FromMinutes` | 60 | +| `sec` | Seconds | `FromSeconds` | 1 | +| `ms` | Milliseconds | `FromMilliseconds` | 0.001 | +| `tick` | Ticks | `FromTicks` | | These suffixes are not combinable with multiplier suffixes or type suffixes. From 10fa6ef428f238f35fbe2ca34df7d4f9c1097597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Sun, 9 May 2021 14:01:17 +0200 Subject: [PATCH 07/11] More info, less info --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index be2599a16..c54700b66 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -1,10 +1,10 @@ --- -RFC: RFC +RFC: RFCNNNN Author: Anselm Schüler Status: Draft Area: Syntax and Cmdlet implementation -Comments Due: Plan to implement: Yes +Breaking change: Yes --- # `TimeSpan` Literals and support for `TimeSpan` objects in Cmdlets such as Start-Sleep From 03cb4506845fc3e189666f8dd03f30a40fcb0391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Sun, 9 May 2021 14:20:01 +0200 Subject: [PATCH 08/11] removed LTS query from URL --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index c54700b66..905606c60 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -9,7 +9,7 @@ Breaking change: Yes # `TimeSpan` Literals and support for `TimeSpan` objects in Cmdlets such as Start-Sleep -A new syntax expansion that adds support for `TimeSpan` literals, and cmdlets such as `Start-Sleep` accepting `TimeSpan` objects by default - this entails adding new suffixes to numeric literals as [described here](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/About/about_numeric_literals?view=powershell-7). +A new syntax expansion that adds support for `TimeSpan` literals, and cmdlets such as `Start-Sleep` accepting `TimeSpan` objects by default - this entails adding new suffixes to numeric literals as [described here](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/About/about_numeric_literals). This is helpful as current methods for time specification have significant drawbacks (see Motivation). This solution is significantly more concise than using `New-TimeSpan` (see User Experience). From e00d3037eb7f866a3bded2b0d9cca3d9d674606d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Mon, 10 May 2021 07:32:34 +0200 Subject: [PATCH 09/11] add info on experimental feature --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index 905606c60..bf1e1bdf6 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -13,6 +13,8 @@ A new syntax expansion that adds support for `TimeSpan` literals, and cmdlets su This is helpful as current methods for time specification have significant drawbacks (see Motivation). This solution is significantly more concise than using `New-TimeSpan` (see User Experience). +Initially, this will be implemented in an experimental feature. + ## Motivation ### Practicality @@ -129,6 +131,8 @@ The `Start-Sleep` cmdlet is expanded to allow a `-TimeSpan` parameter, where a ` The behaviour of `Start-Sleep` when only one anonymous parameter is given is that a non-`TimeSpan` object is interpreted as an argument to parameter `-Seconds` and a `TimeSpan` object is interpreted as argument to parameter `-TimeSpan`. +All of this is only enabled when an experimental feature called `TimeSpanLiterals` is enabled. + ## Related [Related proposal on the PowerShell issues page](https://github.com/PowerShell/PowerShell/issues/10712) From b3d21cd88d715152f114b8acd6aedfa9f6c99083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Mon, 10 May 2021 17:56:10 +0200 Subject: [PATCH 10/11] fix wrong suffix --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index bf1e1bdf6..b2fac12cf 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -52,7 +52,7 @@ Result: Sleep for 20 seconds --- ```pwsh -Start-Sleep 5m +Start-Sleep 5min ``` Result: Sleep for 300 seconds From 70af907c8f34d51f544dd3b756743bc3bf64cb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Tue, 18 May 2021 21:52:16 +0200 Subject: [PATCH 11/11] Added example for combining minutes and seconds This addresses a review comment by @SteveL-MSFT (https://github.com/PowerShell/PowerShell-RFC/pull/246#discussion_r634684434) modified: 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md --- 2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md index bf1e1bdf6..892003510 100644 --- a/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md +++ b/2-Draft-Accepted/RFCNNNN-TimeSpan-Literals.md @@ -67,6 +67,22 @@ Result: Sleep for 0.1 seconds --- +```pwsh +Start-Sleep (1min + 30sec) +``` + +Result: Sleep for 90 seconds + +--- + +```pwsh +Start-Sleep (2min + 35sec) +``` + +Result: Sleep for 155 seconds + +--- + ```pwsh $TimeSpan = 15sec $TimeSpan