I am learning PowerShell and I had a question about passing parameters. I wanted to create a function that allows you to pass in 2 integer parameters. It takes the first parameter and 'raises' it to the magnitude of the second number. ie get-power(3,2) would be 9. It appears that when I run this function that it creates an array. How do I either use the values inside the array to complete the function or am I missing a step or concept.
function get-power{
Param
(
[Parameter(Mandatory=$true, Position =0)]
[int]$arg1,
[Parameter(Mandatory=$true, Position= 1)]
[int]$arg2
)
[math]::Pow([int]$arg1, [int]$arg2)
}
get-power 3 2. Your function works as is.