PowerShell is not Docker, and PowerShell won't be able to parse or understand docker commands.
If you want to write a dockerfile from PowerShell, do like you would to write any other text file:
"FROM mcr.microsoft.com/dotnet/aspnet:3.1" |Add-Content .Dockerfile
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…