visual studio code touch command not recognized - github

Visual Studio Code is not recognizing the touch index.html command . It used to work. Now I get this error:
PS C:\Users\kimim_000\mynewprofile> touch index.html
touch : The term 'touch' 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:1
touch index.html
+ CategoryInfo : ObjectNotFound: (touch:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

I had the same issue as well. I used "code" in place of "touch" to create my file.

Are you using PowerShell?
I think this answer explains it well if you are.
https://stackoverflow.com/a/67665941/15102120
Basically, touch isn't a PowerShell or Windows command. The command if this is the issue is New-Item or Get-Item

Related

error in executing lua code in vscode powershell terminal

i normally execute my lua files in the terminal with lua file-name.lua. i recently found out that you could also execute the code from terminal using lua53 .\file_name.lua where the lua version was 5.3
the lua version that im using is 5.1 so i entered lua51 .\file_name.lua on my terminal but i was given this error instead
lua51 : The term 'lua51' 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:1
+ lua51 .\main.lua
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (lua51:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
the lua version that im using is 5.1 so i entered
lua51 .\file_name.lua
on my terminal but i was given this error instead
try to write this
lua5.1 .\file_name.lua

The term ' ' not recognized as the name of a cmdlet, function, script file, or operable program

I am trying to make a water-level capacitatnce sensor similar to the one here:
https://www.youtube.com/watch?v=40TjjWLljaU
So I downloaded the code provided in the description. I think I did all the necessary pre-requesits.
I opened the file where the code is downloaded and went to terminal> run task > build IDF. I get this error. What I understood is that it is trying to fetch the code from the original users directory. So my questoion would be, how can I make it run the code from my computer?
The term '/LOCATION_OF_FILE_IMPORTED' 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:61
+ /home/****/.espressif/python_env/idf4.2_py3.6_env/bin/python <<<< /home/kris/esp/esp-idf/tools/idf.py build
+ CategoryInfo : ObjectNotFound: (/home/****/.esp..._env/bin/python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Thank you for your time and help in advance.

Why do I have a terminal error in VS Code?

I'm trying to learn Python using VS Code. Onde of my task is to opne a file from folder in VS Code nad then run a terminal but when I'm opening it i have error like below in temrinal
PS C:\Users\Łukasz\Desktop\Exercise Files> & C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe "c:/Users/ukasz/Desktop/Exercise Files/Chap02/02_07_begin.py"
& : The term 'C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe' is not recognized as the name of a cmdlet, function, script file, or operable progra
m. 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/ukasz/AppData/Local/Programs/Python/Python39/python.exe "c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:/Users/ukasz/...on39/python.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\Łukasz\Desktop\Exercise Files>
Could you explain me what I'm doing wrong? I'm not sure what's wrong in the file path and what I can change. I was just adding a file from my desktop, and also just installing a Python on my computer, nothing more.
If it help - I'm learning from the Linkedin Learnign, so I'm just trying to do what they say ;)

PowerShell The term 'which' is not recognized as cmdlet function script file or operable program

I am using PowerShell and want to do a which command, however I am seeing this error:
which : The term 'which' 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:1
+ which xxxxxx
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (which:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I have done a search on Google and there is no specific answer to my question. Has anyone encountered the same error before and how can I fix it?
Putting an answer together from the comments:
which is a standard command of Linux, but is not normally present on Windows.
The equivalent command is Get-Command, or if you have it, you can run where.exe.

Open program files directory using powershell and env variable

My goal is to create a PowerShell script, which would open specific directories in Windows Explorer.
Some of the directories could be referenced through the environment-variables.
However I got a problem with the following command
ii %programfiles(x86)%
Execution returns the following error:
The term 'x86\' 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:23
+ ii %programfiles\(x86\ <<<< )%
+ CategoryInfo : ObjectNotFound: (x86\:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Can you kindly explain to me, what I'm doing incorrectly here?
%variable% is batch notation. In PowerShell you have to use $env: to access environment variables.
Invoke-Item ${env:ProgramFiles(x86)}
The curly brackets are required, because without them the parentheses wouldn't be recognized as part of the variable name.