Since homebrew updated in 2021, the `brew cask install dotnet-sdk` command is now supposed `brew install --cask dotnet-sdk`