Windows 10: WSL scripts not working when called from windows

Discus and support WSL scripts not working when called from windows in Windows 10 Software and Apps to solve the problem; I am hoping to run wsl bash scripts from windows so that my windows task scheduler can run wsl scripts as well.I set my task scheduler to call... Discussion in 'Windows 10 Software and Apps' started by andy an, Apr 25, 2022.

  1. andy an Win User

    WSL scripts not working when called from windows


    I am hoping to run wsl bash scripts from windows so that my windows task scheduler can run wsl scripts as well.I set my task scheduler to call wsl.exemy windows task scheduler is not calling the scripts correctly.when I type from power shellwsl.exe <name_of_script> such aswsl.exe wsl_upgI get:/bin/bash: wsl_upg: command not foundThis only happened to my desktop computer recently.It was working fine before I reinstalled WSL.calling the scripts while I am in wsl works though.what I tried:I tried setting default user usingubuntu2004.exe config --default-user andyI edited the PATH variable o

    :)
     
    andy an, Apr 25, 2022
    #1

  2. PowerShell scripts not working with Call operator

    Hi,



    Thank you for writing to Microsoft Community Forums.



    I understand that you are facing issues while developing a PowerShell script using the Call operator. I would suggest you to refer the articles

    The Windows PowerShell ISE
    .



    However, as the issue is related to developing PowerShell scripts, I would suggest you to post your query on

    MSDN forums
    , where we have expertise and developers who are well equipped with the knowledge of developing PowerShell scripts in Windows.



    Regards,

    Prakhar Khare

    Microsoft Community – Moderator
     
    Prakhar_Khare, Apr 25, 2022
    #2
  3. WSL in windows Store

    Actually, this is a consumer-oriented forum for general Windows 10 questions.

    As WSL concerns mostly developers and Enterprise, I suggest asking there.
     
    Sumit Dhiman2, Apr 25, 2022
    #3
  4. PowerNoob Win User

    WSL scripts not working when called from windows

    PowerShell scripts not working with Call operator

    Hello

    I have been developing a Powershell script using Powershell ISE, and for the most part i am very happy about it, however i have encountered what i believe to be a bug in the call operator (&).

    When i use the call operator followed by a "pure" string everything works as it should, the command works and ISE runs as usual, but when i use the call operator followed by a variable, the command executes correctly, however ISE will no longer use the
    intellisense function to automatically show a drop-down list of possible variables when using "$". It is still possible to press ctrl + space to force the drop-down to appear. This error will disappear when you delete the call operator or the variable.

    Here is an eksample:
    (This courses the problem)
    $c = 'C:\Path\To\Script'
    & $c

    (This does not course the problem)
    & 'C:\Path\To\Script'

    I hope someone is able to help me understand what is happening here, and if it is a bug then give me an alternative solution to executing a script on the local PC though a script.

    I use Powershell version 5.1.17763.503

    ***Original title: The Powershell call operator breaks my ISE***
     
    PowerNoob, Apr 25, 2022
    #4
Thema:

WSL scripts not working when called from windows

Loading...
  1. WSL scripts not working when called from windows - Similar Threads - WSL scripts working

  2. Audio from other apps not working when I'm on a call

    in Windows 10 Software and Apps
    Audio from other apps not working when I'm on a call: When I'm in a Teams meeting or discord vc, the audio from other apps - suppose I'm playing a YT video on edge - is completely muted. This has been happening only for a while, probably a few weeks... How can I fix it?...
  3. Audio from other apps not working when I'm on a call

    in Windows 10 BSOD Crashes and Debugging
    Audio from other apps not working when I'm on a call: When I'm in a Teams meeting or discord vc, the audio from other apps - suppose I'm playing a YT video on edge - is completely muted. This has been happening only for a while, probably a few weeks... How can I fix it?...
  4. Microphone not working when calling

    in Windows 10 Gaming
    Microphone not working when calling: When I call from my phone via Bluetooth, my microphone doesn't work. I tried using the official Your Phone application as well as some other ones like Intel Unison, but neither of them worked. In any other app, my mic functions just fine. Whenever I choose my headset...
  5. Microphone not working when calling

    in Windows 10 Software and Apps
    Microphone not working when calling: When I call from my phone via Bluetooth, my microphone doesn't work. I tried using the official Your Phone application as well as some other ones like Intel Unison, but neither of them worked. In any other app, my mic functions just fine. Whenever I choose my headset...
  6. WSL Not Working

    in Windows 10 Gaming
    WSL Not Working: Hello,My WSL is not working on my laptop. It crashes immediately after running the Ubuntu app and trying to launch it in the command and PowerShell prompts. I have turned off the hypervisor feature and turned it back on. I have done the same for the virtual environment...
  7. WSL Not Working

    in Windows 10 Software and Apps
    WSL Not Working: Hello,My WSL is not working on my laptop. It crashes immediately after running the Ubuntu app and trying to launch it in the command and PowerShell prompts. I have turned off the hypervisor feature and turned it back on. I have done the same for the virtual environment...
  8. WSL scripts not working when called from windows

    in Windows 10 Gaming
    WSL scripts not working when called from windows: I am hoping to run wsl bash scripts from windows so that my windows task scheduler can run wsl scripts as well.I set my task scheduler to call wsl.exemy windows task scheduler is not calling the scripts correctly.when I type from power shellwsl.exe <name_of_script> such...
  9. WSL not working

    in Windows 10 Ask Insider
    WSL not working: WSL with Ubuntu 20.04 was working fine until I updated to version 20197.1000. After updating I'm unable to start a WSL shell or install a new distribution. I can't even access Linux folder in windows file explorer. I can't even install another version of Linux from the...
  10. PowerShell scripts not working with Call operator

    in Windows 10 BSOD Crashes and Debugging
    PowerShell scripts not working with Call operator: Hello I have been developing a Powershell script using Powershell ISE, and for the most part i am very happy about it, however i have encountered what i believe to be a bug in the call operator (&). When i use the call operator followed by a "pure" string everything works...