Windows 10: Powershell Core "Sudo" returns "Command not found" almost always

Discus and support Powershell Core "Sudo" returns "Command not found" almost always in Windows 10 Software and Apps to solve the problem; Except for a few commands that are inherently admin-only, sudo simply does not work in Powershell Core or Powershell 5 for that matter.Details: I want... Discussion in 'Windows 10 Software and Apps' started by Kilian Bosse, Dec 3, 2024.

  1. Powershell Core "Sudo" returns "Command not found" almost always


    Except for a few commands that are inherently admin-only, sudo simply does not work in Powershell Core or Powershell 5 for that matter.Details: I want to delete a write-protected folder.Remove-Item <item> returns something about insufficient rights as expected.Sudo Remove-Item <item> returns "Command not found".I have enabled Sudo. I tested it sudo netstat -ab behaves as expected with just netstat -ab faling as expected and it works for netstat and sudo -V returns 1.0.0. For everything else? It fails to recognize the command. I tried putting the command afterwards in quota

    :)
     
    Kilian Bosse, Dec 3, 2024
    #1
  2. Kursah Win User

    PowerShell instead of Commandline in Creators Update

    Interestingly enough my personal laptop just got the update...and still has Command Prompt listed, not PowerShell...

    Edit: Not that it matters...I use both regularly. *Toast :toast:
     
    Kursah, Dec 3, 2024
    #2
  3. cknoettg Win User
    WSL run commands on boot as sudo

    I may just be misinterpreting what you are saying, but what you are asking for cannot be done.

    You cannot run sudo commands for the Ubuntu VM from the Windows login screen.

    You can configure your Ubuntu vm to run those commands when the vm is started in WSL, but you aren't going to be able to inject those commands from inside Windows itself.

    - - - Updated - - -

    I realize I was being unimaginative.

    You could set a PowerShell or cmd line script as a batch file to run WSL Ubuntu when Windows is started.
    Then configure your WSL Ubuntu distro to run the sudo commands when it is thereby started.

    This recent blog post might hold some clues:
    Using WSL to Launch Several Bash Command from an Application - Rick Strahl's Web Log
     
    cknoettg, Dec 3, 2024
    #3
  4. Naki Win User

    Powershell Core "Sudo" returns "Command not found" almost always

    GPU-Z what command line parameter ?

    Suggestion: /? (-?) and /help (-help) command-line arguments to show a list of all possible arguments in a small window. *Smile Powershell Core "Sudo" returns "Command not found" almost always :)
     
    Naki, Dec 3, 2024
    #4
Thema:

Powershell Core "Sudo" returns "Command not found" almost always

Loading...
  1. Powershell Core "Sudo" returns "Command not found" almost always - Similar Threads - Powershell Core Sudo

  2. sudo dir not working powershell

    in Windows 10 Gaming
    sudo dir not working powershell: in powershell when i type sudo dir its says command not found. but when i type only dir it worksdir with no sudo in front in powershell worksbut sudo dir in cmd works finefrom what i know dir is not a cmdlet of powershell...
  3. sudo dir not working powershell

    in Windows 10 Software and Apps
    sudo dir not working powershell: in powershell when i type sudo dir its says command not found. but when i type only dir it worksdir with no sudo in front in powershell worksbut sudo dir in cmd works finefrom what i know dir is not a cmdlet of powershell...
  4. Powershell Core "Sudo" returns "Command not found" almost always

    in Windows 10 Gaming
    Powershell Core "Sudo" returns "Command not found" almost always: Except for a few commands that are inherently admin-only, sudo simply does not work in Powershell Core or Powershell 5 for that matter.Details: I want to delete a write-protected folder.Remove-Item <item> returns something about insufficient rights as expected.Sudo...
  5. Every command of PowerShell is broken saying "command was found in the module"

    in Windows 10 Gaming
    Every command of PowerShell is broken saying "command was found in the module": I can't use powershell anymoreInfo:powershell is v1.0 according to $PSHOMELiterary no commands are working including cd and echohere is the image:What I have tried:change ExecutionPolicy, it was remoteSigned, now it is unrestrictedsfc /scannow showingand here is the log:...
  6. Every command of PowerShell is broken saying "command was found in the module"

    in Windows 10 Software and Apps
    Every command of PowerShell is broken saying "command was found in the module": I can't use powershell anymoreInfo:powershell is v1.0 according to $PSHOMELiterary no commands are working including cd and echohere is the image:What I have tried:change ExecutionPolicy, it was remoteSigned, now it is unrestrictedsfc /scannow showingand here is the log:...
  7. Every command of PowerShell is broken saying "command was found in the module"

    in Windows 10 BSOD Crashes and Debugging
    Every command of PowerShell is broken saying "command was found in the module": I can't use powershell anymoreInfo:powershell is v1.0 according to $PSHOMELiterary no commands are working including cd and echohere is the image:What I have tried:change ExecutionPolicy, it was remoteSigned, now it is unrestrictedsfc /scannow showingand here is the log:...
  8. Can't run almost any commands in cmd/powershell

    in Windows 10 Gaming
    Can't run almost any commands in cmd/powershell: Basically, adb : The term 'adb' 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 + adb + ~~~ + CategoryInfo :...
  9. Can't run almost any commands in cmd/powershell

    in Windows 10 Software and Apps
    Can't run almost any commands in cmd/powershell: Basically, adb : The term 'adb' 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 + adb + ~~~ + CategoryInfo :...
  10. WSL run commands on boot as sudo

    in Windows 10 Support
    WSL run commands on boot as sudo: I have pihole installed on ubuntu linux. It works fine except i have to manually run couple of commands on windows boot. I am running windows 10 home 18363.836. I want those commands to run on windows boot and if it can happen even before i logon to windows would be best. And...