I get this error when I run a .py file in vs code, it says something is not recognized , can anyone help me to fix that? - python-3.x

I get this error when I run a .py file in vs code:
n38-32" "c:/Users/hassan kh/Desktop/MY FOLDER/Python Projects/1_1.py"
& : The term 'C:/Users/hassan kh/AppData/Local/Programs/Python/Python38-32' 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:3
+ & "C:/Users/hassan kh/AppData/Local/Programs/Python/Python38-32" "c:/Users/hassa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:/Users/hassan...hon/Python38-32:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I deleted Python and vs code and installed it again but I get this error yet. if anyone knows or had this problem before, please let me know how can I fix it?

Isn't the path should be with backward slash \ in the path.

Related

Oh My Posh seems to randomly throw an exception and does not load the cli

For some reason, OMP will throw this error, seemingly randomly, and will not load the input line.
It happens in VSC and VSCodium, as far as I have noticed.
Restarting the programs or opening a new terminal does not help, it just shows the error below again and again.
If I leave the console open it also spams a new line infinitely. SMH...
Then, suddenly, as randomly as it seems to happen, everything works again.
Usually after a few minutes, which is pretty annoying if I need the terminal right there and then.
I am using a custom local config for OMP.
Any advice about what to even check would be appreciated.
Set-PSReadLineOption : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.
At line:381 char:5
+ Set-PSReadLineOption -ContinuationPrompt (#(Start-Utf8Process $sc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-PSReadLineOption], TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.SetPSReadLineOption

How do I use vsts-task-lib to get the path where build task's files are dropped?

My custom build task is running on an agent, and its files are located at E:\agent_work\_tasks\MyTaskName_106598a6-d5ba-4038-8dc8-ba0172210a94\0.0.13. Is there a way to use vsts-task-lib to get this path?
If I were able to get the task id, name, and version sourced from the task.json, I could determine the path myself by doing something like, tl.getVariable('Agent.WorkFolder') + '\\_tasks\\' + taskName + '_' + taskIdentifier + '\\' + taskVersion.
I had my eyes on https://github.com/Microsoft/vsts-task-lib/blob/master/node/docs/vsts-task-lib.md#taskgetTaskVariable, but wasn't sure of the variable names to use or if this was even along the right path.
You can get current path by using __dirname (nodejs) or $PSScriptRoot (powershell) in your build/release task extension.
For example:
NodeJs:
console.log(__dirname)
PowerShell:
Write-Host $PSScriptRoot

I am getting the below error while starting hybrisserver.bat

'findstr' is not recognized as an internal or external command, operable program or batch file. Usage: "G:\HybrisPendrive\Hybris\hybris\bin\platform\tomcat\bin\wrapper.bat" { console : start : pause : resume : stop : restart : install : remove : update } You can give _YWRAPPER_CONF as env. variable to set the path of the used wrapper configuration file. Defaults to '..\conf\wrapper.conf'.
You are probably missing system32 in your PATH variable. Try adding C:\Windows\System32 to your path variable. Info how to do this: here
Good luck

A parameter cannot be found that matches parameter name 'MaxSizeGB'

New-AzureSqlDatabase command on execution suddently started failing with parameter not found message. MSDN link mentions the parameter as supported.
https://msdn.microsoft.com/en-us/library/dn546722.aspx
Command : New-AzureSqlDatabase
Input
PS C:\scripts>$database1 = New-AzureSqlDatabase -ServerName
"lpqd0zbrseg" -DatabaseName "Database1" -Edition "Business" -MaxSizeGB
50 -Collation "SQL_Latin1_General_CP1_CI_AS"
Output Error
New-AzureSqlDatabase : A parameter cannot be found that matches
parameter name 'MaxSizeGB'. At line:1 char:103
+ ... dition "Basic" -MaxSizeGB 1 -Collation "SQL_Latin1_General_CP1_CI_AS"
+ ~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-AzureSqlDatabase], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands.Sql.Database.Cmdlet.NewAzureSqlDatabas
What would be the reason that MaxSizeGB parameter got not found on execution. Thanks in advance
With Regards,
H Bala
Business and Wed editions are a deprecated service level. Now, the service levels are Free, Basic, Standard & Premium as the error shows.
About the parameter, are you using the Azure PowerShell module configured as "Resource Manager" or "Service Management"? The first one hasn't that value but the second one have it.
You can change it with "Switch-AzureMode". You can find the explanation in the second section of the page.
Source Code of Resource Manager command
Source Code of Service Management command

I want to add web part in web part zone using powershell script

I want to add web part in the web part zone programmatically only using power shell script
I am getting this exception using power shell scripting
Exception code
$webPart = $webpartmanager.ImportWebPart($xmlReader, $errorMsg) -as [Microsoft.SharePoint.WebPartPages.WebPart]
Argument: '2' should be a System.Management.Automation.PSReference. Use [ref].
+ $webPart = $webpartmanager.ImportWebPart <<<< ($xmlReader, $errorMsg) -as [Microsoft.SharePoint.WebPartPages.WebPart]
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : NonRefArgumentToRefParameterMsg
Have you tried what the error message suggests (note the addition of [ref] before $errorMsg)?
$webPart = $webpartmanager.ImportWebPart($xmlReader, [ref]$errorMsg)
-as [Microsoft.SharePoint.WebPartPages.WebPart]

Resources