1 <# 2 3 .SYNOPSIS 4 This material is used in Prakashan Korambath's PowerShell tutorial to demostrate function call 5 6 .EXAMPLE 7 8 PS > function_example <value> 9 10 #> 11 12 param( 13 [Parameter(Mandatory=$True)] 14 15 [double] $Fahrenheit 16 ) 17 18 ## Convert Fahrenheit to Celsius 19 function ConvertFToC([double] $fahrenheit) 20 { 21 $celsius = ($fahrenheit - 32)/1.8 22 $celsius 23 } 24 25 $celsius = ConvertFToC $fahrenheit 26 Write-Host "Temperature in Celsisus : = " $celsius.ToString("#.##") "degree Celsius"