Is there a way to clear the return values inside of a function so I can guarantee that the return value is what I intend? Or maybe turn off this behaviour for the function?<
Set variable scope to script or global.
function Get-Greeting { 'Hello Everyone' $greeting = 'Hello World' 'Ladies and Gentlemen' $script:greeting = $greeting } Get-Greeting $greeting <== 'Hello World'