Why after starting .exe in Docker on windowsServerCore it always stops?

I am using WindowsServerCore 2019 and I want to set ip address for my container and start my application. For this purpose I use powershell script:

$ip_address = ""
$subnet_mask = ""
$gateway = ""
netsh interface ip set address name="Ethernet" static $ip_address $subnet_mask $gateway
Start-Process  "C:\prog\main.exe" -wait

After script ran in terminal I can use command ipconfig, and my ip address has been changed, but my app has been started and after some seconds container stopped. Why did this happen ?

My docker compose:

version: '3'

    build: ./sa
    command:  powershell.exe -ExecutionPolicy Bypass -File ./work/script_static_ip.ps1 

What does the dockerfile of your container looks like? Also, I don’t think setting up IP address for the container is supported.