I would like to clean my external output folder before publish. The solution I have today is the following:
Remove-Item -Path ..\artifacts -ErrorAction SilentlyContinue -Recurse -Force;
dotnet publish ..\myproject.sln -c Release -o ..\artifacts\myproject;
Is there a better way to do this (without Remove-Item)? I've tried using dotnet clean and specifying the output folder but is not working.