211networking witH windows PowersHell
function multiplication2 ($value1, $value2)
{
“Processing Multiplication”
$product = $value1 * $value2
$product
}
To run the function in Windows PowerShell, use the following command:
C:\PS> $p = multiplication2 10 2
C:\PS> $p
As shown in Figure 6.4, the output is also
Processing Multiplication
20
6.2.3 Windows PowerShell Scripts
A Windows PowerShell script is a le that contains the PowerShell source code and
has the.ps1 le extension. Similar to a scripting language such as Perl, Python, or
VBScript, the PowerShell script is exible and portable. e PowerShell script code is
not compiled at runtime but is rather interpreted. To support scripting, a PowerShell
package provides two components, PowerShell runtime envi ...