Created
August 3, 2022 14:51
-
-
Save Timberfang/4d9ca7a8f5440c1def56e740dedc2fda to your computer and use it in GitHub Desktop.
Simple wrapper for New-TimeSpan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-StrictMode -Version 3.0 | |
#Requires -Version 3.0 | |
[int]$Hours = Read-Host -Prompt "Enter the number of hours" | |
[int]$Minutes = Read-Host -Prompt "Enter the number of minutes" | |
[int]$Seconds = Read-Host -Prompt "Enter the number of seconds" | |
if(-not($Hours)){ | |
$Hours = 0 | |
} | |
if(-not($Minutes)){ | |
$Minutes = 0 | |
} | |
if(-not($Seconds)){ | |
$Seconds = 0 | |
} | |
New-TimeSpan -Hours $Hours -Minutes $Minutes -Seconds $Seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment