Someone needs to update the documentation on that page to properly represent the commands to run. \
is not a line continuation character for any native windows cli, but that shouldn’t even be necessary to specify.
PS> SonarScanner.MSBuild.exe begin /o:"MyOrgName" /k:"MyProject" /d:sonar.host.url="https://sonarcloud.io"
<it reports about 10 lines of output>
PS> msbuild.exe .\My.sln /t:Clean,Build
<the usual build log output>
PS> SonarScanner.MSBuild.exe end
That is the correct syntax for powershell for this command using msbuild.exe. Substitute dotnet build
if you like typing more (or want to be trendy)
Even after that I get
ERROR: JAVA_HOME not found in your environment, and no Java
executable present in the PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation, or add "java.exe" to the PATH
But I’m running a scan for .net, not Java. Is Java a prereq? I dont see it on the sonarscanner install page and would love to avoid installing that and getting the constant “update me now” notifications if possible.