You can also just assign everything to null, and then return just the variable you want:
Function TestReturn {
$Null = @(
Write-Output "Hi there!"
1 + 1
$host
$ReturnVar = 5
)
return $ReturnVar
}
You can also just assign everything to null, and then return just the variable you want:
Function TestReturn {
$Null = @(
Write-Output "Hi there!"
1 + 1
$host
$ReturnVar = 5
)
return $ReturnVar
}