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. Deepak_Krishnan R Win User

    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. ReFS cannot fix corruption--can file be accessed at all?

    in Windows 10 Support
    ReFS cannot fix corruption--can file be accessed at all?: With Windows 10 Pro for Workstaions: If integrity streams settings are enabled and an error is returned instead of requested data because ReFS is unable to correct a corruption, can the data still be accessed by disabling integrity streams? If not, is there some other way to...
  3. Cannot Fix or Delete email account from Windows 10

    in Windows 10 Customization
    Cannot Fix or Delete email account from Windows 10: I get frequent alerts for 3 of my 4 email accounts that the account is out of date and needs to be fixed. I click the option to Fix the account and nothing happens. Going into the Mail app to attempt the same doesn't work either. Also cannot delete or update the account...
  4. Fix: Cannot remove a Language from Windows 10

    in Windows 10 News
    Fix: Cannot remove a Language from Windows 10: [ATTACH] Windows has supported multiple languages from the start. Now, it even lets you have multiple languages installed on your PC. You can use one for display, while other can be used to type, and so on. That said, Windows 10 [...] This post Fix: Cannot remove a Language...
  5. Latest update altered resolution, cannot fix

    in Windows 10 Graphic Cards
    Latest update altered resolution, cannot fix: The latest update installed when I turned my PC on this morning and my resolution has been changed. It's set slightly too large, with the display going outside the borders of the screen. The screen also seems to be a lot brighter than it was before. Before this update, the...
  6. I cannot fix the Windows 10 flashing screen. At my wits end

    in Windows 10 Graphic Cards
    I cannot fix the Windows 10 flashing screen. At my wits end: So I have a home built system that I had Windows 7 on. I did the compatibility test and it passed for 10, so I upgraded. After the upgrade, I would occasionally start getting the flashing screen. Sometimes it would last 20 seconds to 3 minutes or so. Sometimes it would go a...
  7. Cannot run SFC or DISM to fix no audio issue.

    in Windows 10 Performance & Maintenance
    Cannot run SFC or DISM to fix no audio issue.: 5 Days ago I started getting this strange error: "SBCinema2.exe - Bad Image." "C:\Windows\System32\audioses.dll is either not designed to run on Windows or contains an error. Try installing the program again using the original installation media or contact your system...
  8. SFC reveals errors that cannot be fixed

    in Windows 10 Performance & Maintenance
    SFC reveals errors that cannot be fixed: Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log. Note that logging is currently not supported in offline servicing scenarios. I've...
  9. SFC /SCANNOW cannot fix storport.sys

    in Windows 10 Performance & Maintenance
    SFC /SCANNOW cannot fix storport.sys: Hi there, been a while since I was on here. Been getting a few intermittent lock ups here and there and I MAY have narrowed it to the SSD, or specifically old firmware and corrupt files. Firmware was easy enough to resolve, then I used DISM to fix the disk image too -...
  10. How to fix this issue: Windows cannot find 'C:\Users\...

    in Windows 10 Support
    How to fix this issue: Windows cannot find 'C:\Users\...: I can see all my images and files in Windows 10 Explorer but they will not open. I just keep getting the same error message. 91849