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. Cannot get PowerShell script to run

    in Windows 10 Gaming
    Cannot get PowerShell script to run: Hi,No matter what I try I cannot get permission to run a .ps1 file. I always get this error:& : File C:\Program Files\putty\pagentpass.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at...
  3. Cannot get PowerShell script to run

    in Windows 10 Software and Apps
    Cannot get PowerShell script to run: Hi,No matter what I try I cannot get permission to run a .ps1 file. I always get this error:& : File C:\Program Files\putty\pagentpass.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at...
  4. Powershell running in the background and using a LOT of memory. How to fix??

    in Windows 10 Network and Sharing
    Powershell running in the background and using a LOT of memory. How to fix??: Hi, I am running Windows 10 and I've noticed my PC has gotten slower lately. I've deleted a few programs but noticed that powershell is taking around 2000-3000 MB. How can I fix it?...
  5. Powershell running in the background and using a LOT of memory. How to fix??

    in Windows 10 Software and Apps
    Powershell running in the background and using a LOT of memory. How to fix??: Hi, I am running Windows 10 and I've noticed my PC has gotten slower lately. I've deleted a few programs but noticed that powershell is taking around 2000-3000 MB. How can I fix it?...
  6. Powershell running in the background and using a LOT of memory. How to fix??

    in Windows 10 Gaming
    Powershell running in the background and using a LOT of memory. How to fix??: Hi, I am running Windows 10 and I've noticed my PC has gotten slower lately. I've deleted a few programs but noticed that powershell is taking around 2000-3000 MB. How can I fix it?...
  7. Execution Policy in Powershell

    in AntiVirus, Firewalls and System Security
    Execution Policy in Powershell: Hello,For Execution Policy for PowerShell, mine was set to unrestricted, which I changed to restricted, assuming it will make my PC more secure.I tried to learn about this, but I didnt understand whether restricted is the best and the most secure option for someone who uses...
  8. Powershell with CMD/c to run external command with Parameters

    in Windows 10 Customization
    Powershell with CMD/c to run external command with Parameters: Greeting, I have an old command line application call Commandline.exe. it run with a parameter to check then show the result. but it need extra "Enter" to confirm like: commandline.exe -s 4567890 So I preparing the an answer file which is on an "Enter" crlf...
  9. 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...
  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...