About 291,000 results
Open links in new tab
  1. How can I pass an argument to a PowerShell script?

    powershell.exe itunesForward.ps1 Is it possible to pass an argument from the command line and have it applied in the script instead of the hardcoded 30 seconds value?

  2. How to handle command-line arguments in PowerShell

    What is the "best" way to handle command-line arguments? It seems like there are several answers on what the "best" way is and as a result I am stuck on how to handle something as simple as: scri...

  3. How to pass command-line arguments to a PowerShell ps1 file

    Aug 18, 2009 · Enter the script file path and any parameters. File must be the last parameter in the command, because all characters typed after the File parameter name are interpreted as the script …

  4. Correct syntax to pass an argument to my parameter in a PowerShell …

    Dec 9, 2022 · } In this same script which defines the function, you also call the function with the named parameter but you have left out the variable to pass to the function on that call. When the script …

  5. How do I make parameters mandatory in PowerShell?

    Aug 23, 2011 · Make sure the "param" statement is the first one (except for comments and blank lines) in either the script or the function. You can use the "Get-Help" cmdlet to verify the parameters have …

  6. How do I pass multiple parameters into a function in PowerShell?

    If I have a function which accepts more than one string parameter, the first parameter seems to get all the data assigned to it, and remaining parameters are passed in as empty. A quick test script:

  7. Getting all Named Parameters from Powershell including empty and …

    I'd like to show Params in a Powershell-language-compatible format, so that one could easily see & display these params, and then also copy+pasta back into either a script as Param () Defaults …

  8. Switch Parameter in Powershell - Stack Overflow

    Jun 20, 2021 · To assign a value to a switch parameter when calling a function or script you use a slightly different syntax to regular parameters - if you want it to be false you can just omit it, and if …

  9. scripting - How to pass boolean values to a PowerShell script from a ...

    I have to invoke a PowerShell script from a batch file. One of the arguments to the script is a boolean value: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -File .\RunScrip...

  10. Pass Powershell parameters within Task Scheduler

    Jun 16, 2017 · I recommend scheduling the task to use the -File parameter rather than -Command. Example: Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Add …