I want to output the parameters of a function in powershell, but it is displayed the result of the parameters in one single line, so the $VariableHere2 cannot be displayed properly. How do I catch only the $VariableHere2 ?
Function Get-Something {
Param([string]$VariableHere,[string]$VariableHere2)
Write-Output "My variable 1 is $VariableHere"
Write-Output "My variable 2 is $VariableHere2"}
$VariableHere = "test1"
$VariableHere2 = "test2"
Get-Something($VariableHere,$VariableHere2)
Get-Something $VariableHere $VariableHere2, otherwise you're passing an array of two values as one single parameter.