# CMD command not executing

**URL:** <https://forums.docker.com/t/cmd-command-not-executing/38955>\
**Category:** Docker Desktop\
**Tags:** docker, windows\
**Created:** [September 29, 2017, 5:26pm UTC](https://forums.docker.com/t/cmd-command-not-executing/38955 "2017-09-29T17:26:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfleming](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dfleming](https://forums.docker.com/u/dfleming)\
**Post date:** [September 29, 2017, 5:26pm UTC](https://forums.docker.com/t/cmd-command-not-executing/38955/1 "2017-09-29T17:26:19Z")

</div>

Hi All,

For the life of me, I cannot seem to get my provisioning script to execute when I run my container.

This is my docker file

> FROM microsoft/aspnet:3.5-windowsservercore-10.0.14393.1198
> 
> SHELL [“powershell”, “-Command”, “$ErrorActionPreference = ‘Stop’; $ProgressPreference = ‘SilentlyContinue’;”]
> 
> COPY \*.ps1 /Container/
> 
> COPY [“wwwroot”, “/inetpub/wwwroot”]  
> COPY [“Admin”, “/Program Files (x86)Admin”]  
> COPY [“Admin/web.config”, “/Program Files (x86)/Admin/web\_default.config”]
> 
> #ENTRYPOINT [“powershell”]  
> CMD [“powershell.exe”, -NoProfile, -File, C:\Container\Start-Admin.Docker.Cmd.ps1 -Parm1 ‘Hiiii’ -parm2 ‘123’]

I have also tried the shell version of CMD as follows

> CMD powershell -NoProfile -File C:\Container\Start-Admin.Docker.Cmd.ps1 -Parm1 ‘Hiiii’ -Parm2 ‘123’

This is the command I am using.

> docker create --name container image:v1 -p 8001:80

After I create and run the container I see that the script did not run, or failed. However, I can exec into powershell on the container and run the script manually and it works fine and I see all the changes that I need.

> docker exec --interactive --tty container powershell  
> C:\Container\Start-Admin.Docker.Cmd.ps1 -Parm1 ‘Hiiii’ -Parm2 ‘123’

I am just at a loss as to what I am missing regarding CMD.

Thanks!

---

<div class="post-metadata">

**Author:** ![pmario](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/pmario/32/1238_2.png) [@pmario](https://forums.docker.com/u/pmario)\
**Post date:** [September 30, 2017, 8:41pm UTC](https://forums.docker.com/t/cmd-command-not-executing/38955/2 "2017-09-30T20:41:39Z")

</div>

IMO `-verb RunAs` is missing. … but that’s just a guess.
