Guest User

Untitled

a guest
May 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. param(
  2. [CmdletBinding()]
  3.  
  4. [ValidatePattern('^(((?<days>[0-9]+)\+)?((?<hours>[0-9]{1,2}):))?(?<mins>[0-9]{1,2})$')]
  5. [string]$quserTimeString
  6.  
  7. )
  8.  
  9. $quserTimeString -match '^(((?<days>[0-9]+)\+)?((?<hours>[0-9]{1,2}):))?(?<mins>[0-9]{1,2})$' | Out-Null
  10.  
  11. [Timespan]::new($Matches.days, $Matches.hours, $Matches.mins, 0)
Add Comment
Please, Sign In to add comment