Unable to connect SonarQube with SQL server - sonarqube

I am using sonarQube and want to connect to sql server db. I ran following command:
sonar-scanner -D sonar.projectKey=MyProject -D sonar.sources=. -D sonar.jdbc.url=jdbc:sqlserver:localhost;databaseName=sonar;integratedSecurity=true
but I am getting below error:-
databaseName=sonar : The term 'databaseName=sonar' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:241
+ ... -D sonar.jdbc.url=jdbc:sqlserver:localhost;databaseName=sonar;integra ...
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (databaseName=sonar:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Don't put spaces after the 'define' (-D) parameters:
sonar-scanner -Dsonar.projectKey=MyProject -Dsonar.sources=. -Dsonar.jdbc.url=jdbc:sqlserver:localhost;databaseName=sonar;integratedSecurity=true

Related

cURL not recognizing command line parameters (Windows 10)

Not sure what I'm doing wrong, but any command line parameters I try to pass into curl (using double dash) are interpreted as a url.
Running curl --help:
curl : The remote name could not be resolved: '--help'
At line:1 char:1
+ curl --help
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
With a single dash it seems to interpret a url parameter, but it doesn't find certain parameters. Running curl -sSL:
Invoke-WebRequest : A parameter cannot be found that matches parameter name 'sSL'.
At line:1 char:6
+ curl -sSL
+ ~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Curl binary downloaded from https://curl.se/windows/
You can find the answer here: Running curl via powershell - how to construct arguments?
"In PowerShell curl is a built in alias to Invoke-WebRequest cmdlet. And aliases have priority in command resolution. To solve your problem you have more specifically, use curl.exe instead of curl, so command not resolved to alias"

Errors when opening Power Shell or VSC

When I open Windows PowerShell or VSC it prints this message:
Invoke-Expression : At line:1 char:768
... es\Git\cmd;"C:\Users\Shawn\AppData\Local\Microsoft\WindowsApps;C:\Use ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'C:\Users\Shawn\AppData\Local\Microsoft\WindowsApps' in expression or statement.
At C:\Users\Shawn\anaconda3\shell\condabin\Conda.psm1:101 char:9
Invoke-Expression -Command $activateCommand;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand
How do I remedy this so that I can be sure that my system will run things correctly.

Microsoft Virtual Assistant Template deploy failure

I'm attempting to deploy the Microsoft's botframework Virtual Assistant Template solution, but am getting a number of errors thrown when the deploy.ps1 PowerShell script is run. As the script output below shows, the errors stem from additional PowerShell scripts called by the deploy.ps1 script. Anyone seen this before and deal with it successfully?
PS C:\source\repos\stuartbottest1\stuartbottest1> .\deployment\scripts\deploy.ps1
? Bot Name (used as default name for resource group and deployed resources): stuartbottest1
? Azure resource group region: eastus2
? Password for MSA app registration (must be at least 16 characters long, contain at least 1 special character, and contain at least 1 numeric character): Chicrbwisf#stuartbottest1
? LUIS Authoring Region (westus, westeurope, or australiaeast): westus
? LUIS Authoring Key (found at https://luis.ai/user/settings): lasdfljwrlkkjxoiuc
Creating resource group ...
Validating Azure deployment ...
Deploying Azure services (this could take a while)...
Updating appsettings.json ...
Deploying cognitive models ...
Initializing dispatch model ...
dispatch : The term 'dispatch' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\deploy_cognitive_models.ps1:125 char:4
+ (dispatch init
+ ~~~~~~~~ + CategoryInfo : ObjectNotFound: (dispatch:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException > Parsing General LU file ...
ludown : The term 'ludown' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\luis_functions.ps1:10 char:5
+ ludown parse toluis
+ ~~~~~~ + CategoryInfo : ObjectNotFound: (ludown:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException > Deploying General LUIS app ...
luis : The term 'luis' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\luis_functions.ps1:18 char:17
+ $luisApp = (luis import application
+ ~~~~
+ CategoryInfo : ObjectNotFound: (luis:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException ! Could not deploy LUIS model. Review the log for more information. ! Log: C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\..\deploy_cognitive_models_log.txt
Setting LUIS subscription key ...
! Could not create LUIS app. Skipping dispatch add.
Parsing Chitchat LU file ...
ludown : The term 'ludown' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:9 char:5 + ludown parse toqna + ~~~~~~ + CategoryInfo : ObjectNotFound: (ludown:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Deploying Chitchat QnA kb ...
qnamaker : The term 'qnamaker' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:24 char:13
+ $qnaKb = (qnamaker create kb + ~~~~~~~~ + CategoryInfo : ObjectNotFound: (qnamaker:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
2
Retrying ...
qnamaker : The term 'qnamaker' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:24 char:13
+ $qnaKb = (qnamaker create kb
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (qnamaker:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
1 > Retrying ... qnamaker : The term 'qnamaker' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:24 char:13
+ $qnaKb = (qnamaker create kb
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (qnamaker:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException 0 > Retrying ... qnamaker : The term 'qnamaker' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:24 char:13
+ $qnaKb = (qnamaker create kb
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (qnamaker:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException -1 ! Unable to create QnA KB. ! Could not deploy knowledgebase. Review the log for more information.
! Log: C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts..\deploy_cognitive_models_log.txt
! Could not create knowledgebase. Skipping dispatch add.
Parsing Faq LU file ...
ludown : The term 'ludown' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:9 char:5 + ludown parse toqna ` + ~~~~~~ + CategoryInfo : ObjectNotFound: (ludown:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Deploying Faq QnA kb ...
qnamaker : The term 'qnamaker' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:24 char:13
+ $qnaKb = (qnamaker create kb + ~~~~~~~~ + CategoryInfo : ObjectNotFound: (qnamaker:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
2
Retrying ...
qnamaker : The term 'qnamaker' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:24 char:13
+ $qnaKb = (qnamaker create kb
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (qnamaker:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
1 > Retrying ... qnamaker : The term 'qnamaker' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:24 char:13
+ $qnaKb = (qnamaker create kb
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (qnamaker:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
0 > Retrying ... qnamaker : The term 'qnamaker' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\qna_functions.ps1:24 char:13
+ $qnaKb = (qnamaker create kb
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (qnamaker:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
-1
! Unable to create QnA KB.
! Could not deploy knowledgebase. Review the log for more information.
! Log: C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts..\deploy_cognitive_models_log.txt
! Could not create knowledgebase. Skipping dispatch add.
Creating dispatch model...
dispatch : The term 'dispatch' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts\deploy_cognitive_models.ps1:251 char:16
+ $dispatch = (dispatch create `
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (dispatch:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
! Could not create Dispatch app. Review the log for more information.
! Log: C:\source\repos\stuartbottest1\stuartbottest1\deployment\scripts..\deploy_cognitive_models_log.txt
Publishing to Azure ...
Done.
PS C:\source\repos\stuartbottest1\stuartbottest1>
There was no real "fix" to my issue, other than to repeat all the pre-req installation steps a few times.

About MicrosoftTeams-TeamFunSettings

Today I found that the MicrosoftTeams powershell command Get-TeamFunSettings failed to run when the property GiphyContentRating value is "Allow all content".
Error info:
Get-TeamFunSettings : Error converting value "unknownFutureValue" to
type
'System.Nullable`1[Microsoft.TeamsCmdlets.PowerShell.Custom.Model.GiphyRatingType]'.
Path 'funSettings.giphyContentRating', line 1, position 844. At line:1
char:1
+ Get-TeamFunSettings -GroupId a3f33284-82a5-4643-a43d-401f2568177c
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-TeamFunSettings], JsonSerializationException
+ FullyQualifiedErrorId : Newtonsoft.Json.JsonSerializationException,Microsoft.TeamsCmdlets.PowerShell.Custom.GetF
unSettings
We are actively investigating this issue and a fix is expected shortly. Note this commend is in beta so instability is not unexpected.
Maybe it's just very new but according to the documentation of the command "Allow all content" is not an option. (I do think it should be one, though)
https://learn.microsoft.com/en-us/powershell/module/teams/set-teamfunsettings

Powershell: Variable assignment triggers module import

This code works from the Powershell command line but generates an error when run from a script:
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
Set-ItemProperty $key Hidden 1
When I run it from my script, I get the following error:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer : The module 'HKEY_CURRENT_USER' could not be
loaded. For more information, run 'Import-Module HKEY_CURRENT_USER'.
At C:\Users\mybitch\Desktop\VSS-Customize-Desktop.ps1:19 char:6
+ $key=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (HKEY_CURRENT_US...ersion\Explorer:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoLoadModule
This is a simple assignment...Why would Powershell try to import HKEY_CURRENT_USER as a module? Why is the behavior so different from the Powershell command line?
The error message betrays the problem. In your script, apparently you are doing this:
$key = HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
That is an invalid assignment. You should be doing as you describe:
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
Make sure in the script you have the User Hive being loaded, for example if you are running it from a task scheduler you will need it to load a hive for it to have the effect that you want.

Resources