Windows 10: Fix: Cannot run Executables with parameters using PowerShell

Discus and support Fix: Cannot run Executables with parameters using PowerShell in Windows 10 Tutorials to solve the problem; When running a command in-line PowerShell with parameters usually you would do this like & "ipconfig.exe /all". When you run it like that you will get... Discussion in 'Windows 10 Tutorials' started by Noel, Jun 21, 2018.

  1. Noel New Member

    Fix: Cannot run Executables with parameters using PowerShell


    When running a command in-line PowerShell with parameters usually you would do this like & "ipconfig.exe /all". When you run it like that you will get the error saying that it is not recognized.

    & : The term 'ipconfig.exe /all' 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
    + & "ipconfig.exe /all"
    + ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (ipconfig.exe /all:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    This happens due to the fact that the parameters are causing this error. We need to split the parameters from the actual command by running them as below

    $Exec = "ipconfig.exe"
    $Parm = "/all"
    $Parm = $Parm.Split(" ")
    & "$Exec" $Parm



    (17)

    read more...
     
  2. ryanly Win User

    GPU-Z what command line parameter ?

    Current /? (-?) or / help (-help) parameter is invalid
     
    ryanly, Jun 21, 2018
    #2
  3. A123 Win User
    Set Execution Policy in Powershell

    I set the Execution Policy in Powershell to unrestricted to run a couple of command lines and then set the policy back to restricted. Does setting the policy to unrestricted for a small period of time harm Windows 10? Does one have to set the policy back
    to restricted or does closing Powershell and relaunching Powershell put the policy back to restricted?
     
  4. Fix: Cannot run Executables with parameters using PowerShell

    Set Execution Policy in Powershell

    Hi,

    Thank you for posting your query in Microsoft Community.

    I will surely assist you with your query.

    The execution policy is part of the security strategy of Windows PowerShell. It determines whether you can load configuration files (including your Windows PowerShell profile) and run scripts, and it determines which scripts, if any, must be digitally signed
    before they will run.

    Please refer to the link below to know more about Set Execution policy.

    https://technet.microsoft.com/en-us/library/hh849812.aspx

    Hope the above information helps.

    Thank you.
     
    Deepak_Krishnan R, Jun 21, 2018
    #4
Thema:

Fix: Cannot run Executables with parameters using PowerShell

Loading...
  1. Fix: Cannot run Executables with parameters using PowerShell - Similar Threads - Fix Cannot run

  2. Right-Click Run With Parameters

    in Windows 10 Software and Apps
    Right-Click Run With Parameters: Hello. Does anyone have any recommendations for a simple 64-bit compatible Windows program that, when you right-click an exe, bat, msi etc. file, that pops up a menu allowing you to run the file with parameters or arguments? NirExt does this task but the program has not been...
  3. After Last windows10 update april 2019, run and powershell apps do not execute

    in Windows 10 BSOD Crashes and Debugging
    After Last windows10 update april 2019, run and powershell apps do not execute: I can't get the RUN or windows powershell app to execute. nothing happens. Help! https://answers.microsoft.com/en-us/windows/forum/all/after-last-windows10-update-april-2019-run-and/7278c245-a07a-4f9b-834b-bffa1fb9a554
  4. Can not execute/run FCAT-VR in powershell or CMD

    in Windows 10 Support
    Can not execute/run FCAT-VR in powershell or CMD: First posting and I do hope thet it is in the right section, if not feel free to move this to the proper one. My problem: I'm trying to execute FCAT VR (not FCAT) in Win10-64 pro as can be found at the Nvidia site https://www.geforce.com/whats-new/gu...d-how-to-guide...
  5. 10 CMD commands that can be executed with PowerShell

    in Windows 10 News
    10 CMD commands that can be executed with PowerShell: [ATTACH] PowerShell is Microsoft’s own alternative to their own Command Prompt. Earlier, Microsoft announced that they will be open sourcing PowerShell and will be bringing it to recent versions and different Linux flavors like Ubuntu, CentOS, Red Hat Enterprise Linux,...
  6. PowerShell 1 Execution policy is bad in registry

    in Windows 10 BSOD Crashes and Debugging
    PowerShell 1 Execution policy is bad in registry: it was detected as bad by dell who used Norton power eraser to locate the issues in my computer, Norton says they can not fix it, that Microsoft needs to fix it , I came to micorosoft to get help a tech, tried to reinstall Microsoft windows, after the computer restarted a...
  7. Powershell: Add-VpnConnectionTriggerDnsConfiguration missing -AllUserConnection parameter

    in Windows 10 Network and Sharing
    Powershell: Add-VpnConnectionTriggerDnsConfiguration missing -AllUserConnection parameter: I've set up a split-tunnel VPN connection, and am trying to force that connection to use the remote connection's DNS server. To do this, I'm trying to use Add-VpnConnectionTriggerDnsConfiguration in PowerShell. However, the VPN connection is in the Global Phone Book....
  8. Execute Powershell command on remote computer

    in Windows 10 Network and Sharing
    Execute Powershell command on remote computer: Hello, I would like to execute a PowerShell command on a remote computer. The command is the following: Invoke-Command -ComputerName 10.40.27.174 -ScriptBlock { Get-ChildItem C:\ } -credential User I get the following error: [10.40.27.174] La connexion au serveur...
  9. Help with this result using Powershell to fix start button

    in Windows 10 Support
    Help with this result using Powershell to fix start button: I run the Powershell command that is supposed to fix the Start button fail (as well as Cortansa etc) and I got this message that I don't know how to interpret. I made sure that Windows Firewall was running too. 'Windows cannot install package...
  10. Cannot Set Execution Policy in Powershell

    in Windows 10 Support
    Cannot Set Execution Policy in Powershell: Did not experience this problem until this build (10130) but it may have occurred in the build before that also. As you can see in the attachment, I am in Administrator mode but cannot run a script which installs a dozen or so programs. The programs install if I type a...