Can anyone explain why the below code works when saved as a script?
function Get-Test {
Write-Host "In function"
}
Test
The call to the function should be Get-Test. The above code should generate an error but doesn't.
It seems to only work when the Verb on the function name is Get. Anything else generates an error as expected. I've successfully run the code in PS version 2 and 3 at the command line and PS v3 ISE.