[ERR] The Export-ModuleMember cmdlet can only be called from inside a module

My script is a PSM1 file, but UA changes it to psm1.ps1 which causes the error: [ERR] The Export-ModuleMember cmdlet can only be called from inside a module.

Any ideas?

PSM1 files aren’t supported in UA and aren’t actually executable in PS.

You can create a PS1 file and then import your module to use the functionality from it.