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. I USED WINDOWS POWERSHELL WITHOUT CLOSING RUNNING APPS!

    in Windows 10 Customization
    I USED WINDOWS POWERSHELL WITHOUT CLOSING RUNNING APPS!: Hello. I have recently learned that you can uninstall windows default apps using Powershell. So I did just that. Only, to my horror, I realized that I was supposed to close other running apps before doing so. I had chrome open with a list of commands to input, and deleted the...
  3. 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,...
  4. 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...
  5. Run PowerShell Script As An Administrator

    in Windows 10 Support
    Run PowerShell Script As An Administrator: Hi. So I've been searching online on a way to do this yet I cannot find a way to do it. _______________________________________ I need this in specific: I want to double click a PowerShell script file (which will run as an administrator) from Windows Explorer that has...
  6. 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....
  7. 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...
  8. 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...
  9. 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...
  10. Run Multiple Commands In Powershell?

    in Windows 10 Performance & Maintenance
    Run Multiple Commands In Powershell?: Good job, @lx07. Of course, you had the benefit of knowing the OP wanted to run the same command on 3 targets. Had I been armed with that same information, I might have made that same suggestion, too. That's why we're better working together than working individually. --Ed--