functions.ps1/Set-Foo.ps1

function Set-Foo {
    [CmdletBinding()]
    param (
        $Value
    )
    
    $script:Foo = $Value
}