Created
November 19, 2019 04:48
-
-
Save skywalkw3r/33c7a8e3f71b7af9f5f57c598e6aa231 to your computer and use it in GitHub Desktop.
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
function Get-Fahrenheit { | |
[CmdletBinding()] | |
Param( | |
[Parameter(ValueFromPipeline=$true, | |
Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[ValidatePattern('^(\d*\.)?\d+$')] | |
[decimal]$CelsiusTemp | |
) | |
[PSCustomObject]@{ | |
Fahrenheit = "$(($CelsiusTemp*1.8)+32)" | |
Celsius = "$CelsiusTemp" | |
} | |
} | |
function Get-Celsius { | |
[CmdletBinding()] | |
Param( | |
[Parameter(ValueFromPipeline=$true, | |
Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[ValidatePattern('^(\d*\.)?\d+$')] | |
[decimal]$FahrenheitTemp | |
) | |
[PSCustomObject]@{ | |
Celsius = "$(($FahrenheitTemp-32)/1.8)" | |
Fahrenheit = "$FahrenheitTemp" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the feedback!