© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
26 replies
Hejle

Docker - NanoServer - Dotnet with PowershellCore

I have created a DockerFile with Dotnet running in NanoServer, and got a bit annoyed at the CMD in there.
So I have spent hours trying to add PowerShellCore to it.

The closest, I think, is this post:
https://stackoverflow.com/questions/65104246/how-to-install-powershell-core-in-aspnet-nanoserver-docker-container
From there I have been look at this DockerFile:
https://github.com/PowerShell/PowerShell-Docker/blob/master/release/7-3/nanoserver2022/docker/Dockerfile

So, I have tried to run it with the DockerFile i have added.

Running this, my Container is created and everything works, but Powershell has not been added.
From the example in Github, the escapecharacter ` is used:
# escape=`
# Copyright (c) Microsoft Corporation.
# escape=`
# Copyright (c) Microsoft Corporation.


But this fails with: "Syntax error - can't find = in "`". Must be of the form: name=value" so I have changed that to:

# escape=\
# Copyright (c) Microsoft Corporation.
# escape=\
# Copyright (c) Microsoft Corporation.


My DockerFile can be seen here:
Dockerfile.txt5.2KB
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ docker build with dotnet 8
C#CC# / help
3y ago
❔ Docker issues with dotnet restore
C#CC# / help
4y ago
✅ Docker Dotnet restore
C#CC# / help
3y ago
docker-angular-dotnet app
C#CC# / help
2y ago