'Running script only prints script source code!@#$%

This is weird to me. Running a script will only output its source code. Here is an MRE. Naturally, the problem is on a much larger script as well. What kind of crazy am I going to?

PS C:\src\t> Get-Content -Path .\junk.ps1
[CmdletBinding()]
param (
    [Parameter()]
    [string]$S
)
{
    Write-Host $S
}
PS C:\src\t> .\junk.ps1 -S 'now'

    Write-Host $S

PS C:\src\t> $PSVersionTable.PSVersion.ToString()
7.2.1


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source