How can I run `powershell` command on container

My docker image is from which has powershell installed. Why do I get this error when build docker image: /bin/sh: 1: Install-Module: not found

Below is my dockerfile:

RUN Install-Module dbatools -Force

I can run the command Install-Module dbatools -Force when I manually launch a container from Why can’t I run it from building the image? Does it have a different context? If it uses my localhost context, does it mean I need to install powershell on my Mac OS?

If I want to run a powershell script as ENTRYPOINT, how can I specify it?

Source: StackOverflow