Docker Community Forums

Share and learn in the Docker community.

How to string together multiple powershell commands in RUN?

What would be the proper syntax to execute several powershell script on the same RUN command line? I tried different ways but can not come up with proper syntax

ADD server_config.ps1 /windows/temp/server_config.ps1
ADD iis.ps1 /windows/temp/iisconfig.ps1
ADD startup.ps1 /windows/temp/startup.ps1
RUN ["powershell.exe", "c:\\windows\\temp\\serverconfig.ps1"]; \
["powershell.exe", "c:\\windows\\temp\\serverconfig.ps1"]; \
 ["powershell.exe", "c:\\windows\\temp\\iisconfig.ps1"]

I responded on the other thread too.

FROM microsoft/windowsservercore

ADD hello.ps1 .
ADD world.ps1 .

CMD powershell .\hello.ps1 ; .\world.ps1

Sample project.

1 Like